This .bat file uses fsutil to get a list of the drives and types on a windows machine. Batch Script to list Drives and Types ------------------------------------------ Code: @echo off setlocal :: REM Get and list drive types using fsutil :: set "list=" for /f "tokens=*" %%a in ('^ fsutil fsinfo drives^|^ find /V ""' ) do ( set "dv=%%a" call set "list=%%list%% %%dv:~-3%%" ) for %%a in (%list%) do ( fsutil fsinfo drivetype %%a )
If you liked this article do nominate this article for Article of the month - Sep 2010 Before 15th of October 2010.
The original above script does not apply to Windows 7 instead use this to pipe the info using DiskPart Code: @echo off echo.list vol | DiskPart | find /i "partition" echo.list vol | DiskPart | find /i "DVD-ROM" echo.list vol | DiskPart | find /i "Removable"