Running scripts from a from USB drive
I have 1 .cmd file that runs a few things. It then will access a Folder and from within this folder run an .EXE. This all works fine when I run this from c:\temp or anyplace where I "know" the path. but I need to place all of this onto a USB drive. And when the USB drive is plugged into any machine I don't know what Drive Letter will get assigned. How do you code your .cmd file so it will always find the "folder" you want and .EXE within the folder, regardless of the drive letter?
0 Comments
[ + ] Show comments
Answers (3)
Answer Summary:
Within your cmd file, use the "%~dp0" command
Within your cmd file, use the "%~dp0" command
Please log in to answer
Posted by:
dugullett
12 years ago
Posted by:
muebel
12 years ago
Posted by:
andemats
12 years ago