View Single Post
Old 06-19-2015, 06:28 PM   #857
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by BWinmill View Post
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.)
Ugly! Eyeball burn!

Thanks. I will keep this in mind.
eschwartz is offline   Reply With Quote