开发者

Windows PATH variable

开发者 https://www.devze.com 2023-03-06 09:56 出处:网络
My program needs .bat file to run because the .bat file is changing some language settings, so .bat file looks like:

My program needs .bat file to run because the .bat file is changing some language settings, so .bat file looks like:

set lang=en 
start ap.exe

It is working great but when I made installer for my app and pointed .bat file as main file, it creates a shortcut on the desktop to that .bat file. So far everything is great but when I launch that shortcut it cannot open app.开发者_如何转开发exe because it can't find it on desktop.

So my question is: How can I get path to folder of .bat file so I could set proper start command? Something like:

set lang=en

S=getpath();

start S/app.exe

It is just pseudocode but I think you get point.


You can write %~dp0 to get the directory containing the batch file.

Therefore, you can write

"%~dp0app.exe"
0

精彩评论

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

关注公众号