Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Dec 2009
    Posts
    14
    Thanks
    0
    Thanked 1 Time in 1 Post

    Question In DOS: where am I running from?

    This seems like it shouldn't be rocket science but....
    When executing a batch file, say from a flash drive, I'd like to capture the drive letter of that flash drive.

  2. #2
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,438
    Thanks
    33
    Thanked 196 Times in 176 Posts
    %~d0 will give you x: where x is the drive letter.
    cd will give you x:\
    Do you need any more info?
    BATcher

    "The trouble with quotes on the internet is that you can never know if they are genuine."
    Abraham Lincoln
    

  3. The Following User Says Thank You to BATcher For This Useful Post:

    SF99 (2012-04-26)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •