List all drives on the local computer

Ignoring CD, DVD and mapped network drives.

ListLocalDrives.cmd

@echo off
setlocal
For /f "tokens=1* delims=\" %%G In ('FSUTIL FSINFO DRIVES ^| find ":"') Do (call :sub %%G)
goto :eof

:sub
     if /i "%1" NEQ "Drives:" (
         FSUTIL FSINFO drivetype %1 | find "Fixed Drive"
     ) ELSE (
         FSUTIL FSINFO drivetype %2 | find "Fixed Drive"
     )

An alternative method is to run psinfo -d

See the full discussion thread for more detail


© Copyright SS64.com 1999-2014
Some rights reserved