Have you tried using the %CD% environment variable? I think it will populate 
with the directory you're running your script from.  Also, are you doing this 
in VBScript or batch scripting?

________________________________
From: [email protected] 
[mailto:[email protected]] On Behalf Of Adrian Crenshaw
Sent: Friday, March 12, 2010 12:16 AM
To: PaulDotCom Security Weekly Mailing List
Subject: [Pauldotcom] Drive letter from volume name

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

******************************************************************************
This email contains confidential and proprietary information and is not to be 
used or disclosed to anyone other than the named recipient of this email, 
and is to be used only for the intended purpose of this communication.
******************************************************************************
_______________________________________________
Pauldotcom mailing list
[email protected]
http://mail.pauldotcom.com/cgi-bin/mailman/listinfo/pauldotcom
Main Web Site: http://pauldotcom.com

Reply via email to