PaulDotCom mailing list archives

Drive letter from volume name


From: irongeek at irongeek.com (Adrian Crenshaw)
Date: Fri, 12 Mar 2010 01:16:23 -0500

Hi all,
    I'm writing a u3 script of sorts. I need to be able to know where to
copy data to, but the drive letter will change depending on the box I stick
it in. I want to do it all from one command line.Ive found a way as long as
I know my drive's volume name (MyThumb ).  This seems to work:


WMIC logicaldisk list brief |findstr MyThumb > delme.txt && FOR /F
"tokens=1*" %i IN ('type delme.txt') DO set ufddrive = %i\

But is there a cleaner way?


Thanks,
Adrian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pauldotcom.com/pipermail/pauldotcom/attachments/20100312/d6436815/attachment.htm 


Current thread: