Batch file help... determine drive it is run from
This is a discussion about Batch file help... determine drive it is run from in the Windows Software category; This problem is very trivial, but I have been searching all over the place and haven't found an answer. I have a batch file that works on its own. My installer has to call use batch code rather than calling the external batch file, which looks like: START directory\directory\directory\program.
This problem is very trivial, but I have been searching all over the place and haven't found an answer.
I have a batch file that works on its own. My installer has to call use batch code rather than calling the external batch file, which looks like:
START directory\directory\directory\program.exe -param -param param_directory\param_jarfile.jar
This code works fine from the batch.bat file, but from the installer I get an error that the executable cannot be found.
How can I determine the drive the batch file was run from? Given the drive letter I should be able to build the string necessary for the START command to open the file.
I have a batch file that works on its own. My installer has to call use batch code rather than calling the external batch file, which looks like:
START directory\directory\directory\program.exe -param -param param_directory\param_jarfile.jar
This code works fine from the batch.bat file, but from the installer I get an error that the executable cannot be found.
How can I determine the drive the batch file was run from? Given the drive letter I should be able to build the string necessary for the START command to open the file.
Participate in our website and join the conversation
This subject has been archived. New comments and votes cannot be submitted.
Jan 12
Jan 20
0
1 minute
Responses to this topic
well, you can do a CD command that lists the current directory. Redirect that to a text file, then do a FOR loop to extract the c:\ portion.
Been using batch files since '83.
Been using batch files since '83.