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.

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 )

Facebook photo

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

Connecting to %s