PaulDotCom mailing list archives
Drive letter from volume name
From: irongeek at irongeek.com (Adrian Crenshaw)
Date: Fri, 12 Mar 2010 14:14:04 -0500
Thanks, but Tim Medin solution ended up being pretty slick. Tested it, and it worked great. Thanks. Adrian On Fri, Mar 12, 2010 at 10:57 AM, Jim Halfpenny <jim.halfpenny at gmail.com>wrote:
You could enumerate any attached drives and look for a predetermined file name to identify your data drive. It's not exactly elegant but it would work. Jim On 12 March 2010 15:49, Adrian Crenshaw <irongeek at irongeek.com> wrote:Well, it's not running from a drive yet (I'm doing something weird which I'll talk about later). I need the command to go out and find the drive to use. Thanks, Adrian On Fri, Mar 12, 2010 at 9:51 AM, Butturini, Russell < Russell.Butturini at healthways.com> wrote: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:* pauldotcom-bounces at mail.pauldotcom.com [mailto: pauldotcom-bounces at mail.pauldotcom.com] *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 Pauldotcom at mail.pauldotcom.com http://mail.pauldotcom.com/cgi-bin/mailman/listinfo/pauldotcom Main Web Site: http://pauldotcom.com_______________________________________________ Pauldotcom mailing list Pauldotcom at mail.pauldotcom.com http://mail.pauldotcom.com/cgi-bin/mailman/listinfo/pauldotcom Main Web Site: http://pauldotcom.com_______________________________________________ Pauldotcom mailing list Pauldotcom at mail.pauldotcom.com http://mail.pauldotcom.com/cgi-bin/mailman/listinfo/pauldotcom Main Web Site: http://pauldotcom.com
-------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pauldotcom.com/pipermail/pauldotcom/attachments/20100312/22ad3790/attachment.htm
Current thread:
- Drive letter from volume name Adrian Crenshaw (Mar 11)
- Drive letter from volume name Butturini, Russell (Mar 12)
- Drive letter from volume name Adrian Crenshaw (Mar 12)
- Drive letter from volume name Jim Halfpenny (Mar 12)
- Drive letter from volume name Adrian Crenshaw (Mar 12)
- Drive letter from volume name gold flake (Mar 16)
- Drive letter from volume name Adrian Crenshaw (Mar 16)
- Drive letter from volume name Joshua Smith (Mar 17)
- Drive letter from volume name Adrian Crenshaw (Mar 12)
- Drive letter from volume name Butturini, Russell (Mar 12)