Some people use batch files to run other programs or scripts found within the same folder. The problem with this is that people might execute these batch files from other applications. This leads to the current directory being set wrong, and thus not finding the application which is meant to be executed.
However, there exists a solution. To change the current location to that of the executing batch file, simply use the following line within the batch file:
cd %~dp0
More info can be found here.
No comments:
Post a Comment