开发者

How to find the location of the .bat script being called [duplicate]

This question already has answers here: Closed 11 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜