Batch Script to list Drives and Types

Cleptography's Avatar author of Batch Script to list Drives and Types
This is an article on Batch Script to list Drives and Types in Programming.
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
)
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
If you liked this article do nominate this article for Article of the month - Sep 2010 Before 15th of October 2010.
0
Cleptography's Avatar, Join Date: Sep 2010
Go4Expert Member
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"

Last edited by Cleptography; 13Mar2011 at 07:58..