Using WMIC, I want to get only the drive label based on the drive letter:
for /f "skip=1" %a in ('wmic volume where "Driveletter like '%C%'" get label') do echo %a
Now, those of you who understand Windows command line will see why this doesn't work as expected, because I'm "do"ing an echo. So, using the above, the output looks like the following (which isn't what I'm hoping for):
C:\>for /f "skip=1" %a in ('wmic volume where "Driveletter like '%C%'" get label') do echo %a
C:\>echo System
System
C:\>echo
ECHO is on.
The raw output of the WMIC command looks like the following:
Label
System
The goal is to merely skip the first line (why I was trying to use for /f "skip=1"...
) and only get the second line. However, I'm not sure how to merely display this without echoing it.
wmic
? I have a PowerShell based solution if that's of help?