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.

Windows Software 5498 This topic was started by ,


data/avatar/default/avatar04.webp

1 Posts
Location -
Joined 2005-01-12
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.
 

Participate in our website and join the conversation

You already have an account on our website? To log in, use the link provided below.
Login
Create a new user account. Registration is free and takes only a few seconds.
Register
This subject has been archived. New comments and votes cannot be submitted.
Jan 12
Created
Jan 20
Last Response
0
Likes
1 minute
Read Time
User
Users

Responses to this topic


data/avatar/default/avatar04.webp

352 Posts
Location -
Joined 2003-03-28
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.