How to find the location of the .bat script being called [duplicate]
Possible Duplicate:
开发者_开发知识库 How to get folder path from file path with CMD
I have a Windows .bat script that needs to execute a file that is in the same directory as the .bat file, but the .bat script can be called from any directory. How do you find the location of the batch file itself, not just the current directory?
You can write %~dp0
to get the directory containing the .bat
file.
精彩评论