Windows PATH variable
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"
精彩评论