Change to drive using it volume label not drive letter

Home Forums Scripting DOS Command Shell Change to drive using it volume label not drive letter

This topic contains 1 reply, has 2 voices, and was last updated by Avatar wullieb1 4 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Avatar
    confuseis
    Participant
    #165932

    Hi

    Id like to have a batch file that will be able to read my USB even if the drive letter has changed

    To do this I’m thinking I can set the volume label to be e.g. USB001

    Now I need to be able to change to that USB key location from within the batch file.

    kinda like cd USB001

    Anyone have a clue ?

    Thanks

    Confuseis

    Avatar
    wullieb1
    Moderator
    #245351

    CD will only change to the directory and not a volume label AFAIK. However this appears to do what you want it to.

    http://stackoverflow.com/questions/28325246/how-to-use-a-volume-label-in-a-windows-path

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.