Code: Select all
for /F "usebackq tokens=1,2,3,4 " %%i in (`wmic logicaldisk get caption^,description^,drivetype 2^>NUL`) do (
if %%l equ 4 (
stuff I make him do goes here
)
)
Moderator: DosItHelp
Code: Select all
for /F "usebackq tokens=1,2,3,4 " %%i in (`wmic logicaldisk get caption^,description^,drivetype 2^>NUL`) do (
if %%l equ 4 (
stuff I make him do goes here
)
)
Code: Select all
wmic logicaldisk get caption,description,drivetype
Code: Select all
wmic logicaldisk get caption,description,drivetype /format:csv
Code: Select all
@echo off &setlocal
for /f "skip=2 delims=" %%i in (
'2^>nul wmic logicaldisk get caption^,description^,drivetype /format:csv'
) do for /f "tokens=2-4 delims=," %%j in ("%%i") do (
if %%l==4 (
echo Caption %%j
echo Description %%k
echo ~~~~~~~~~~
)
)
pause