It is recommended to have the following command somewhere in the beginning of the batch file:

cd /d %~dp0

The presence of this will run all the commands after it with respect to the location of the running batch file.