View Single Post
Old 06-19-2015, 05:52 PM   #852
BWinmill
Nameless Being
 
Quote:
Originally Posted by eschwartz View Post
Unfortunately, that doesn't actually help in any meaningfully significant way. Scripts cannot get a visual look at My Computer.
I did a quick search for identifying the drive belonging to a volume label in PowerShell, and apparently you can use this:

Get-WMIObject Win32_Volume | ? { $_.Label -eq 'MYLABEL' }

I started with PowerShell since it is much more powerful than batch files. Yet you should be able to do the same thing with batch files using:

for /f %%D in ('wmic volume get DriveLetter^, Label ^| find "yourLabel"') do set usb=%%D

It ain't pretty, but supposedly it gets the job done. (I didn't try these myself since I am under OS X at the moment.)
  Reply With Quote