Jump to content
Compatible Support Forums
Sign in to follow this  
nvidovich

Batch file help... determine drive it is run from

Recommended Posts

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.

 

Share this post


Link to post

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.

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×