I want to use the following for /f
loop to set a variable for further processing.
This is my code:
setlocal EnableDelayedExpansion
for /f "usebackq skip=1" %%a in (
`WMIC logicaldisk get Caption^,VolumeName ^| findstr /r /v "^$"`
) do (
set "drivesUser=%%a"
echo !drivesUser!
)
endlocal
pause
Now this basically works but I would like to also echo the VolumeName
of each drive. How can I fix that?