Batch script current directory

I was just trying to write a batch script that calls another batch script. This one was called by another batch script however, and I was having trouble with “batchfile.bat is not an operable command”. I figured my working directory must be different to what I thought, and indeed it was. The following command at the beginning of your batch file will show you the working directory and help you get the correct location:

echo %CD%

This let me add the necessary “folder/” before “batchfile.bat” and now the script works as intended.

Advertisements

One thought on “Batch script current directory”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s