Windows Symlink & working directory

mklinksymbolic-linkwindows

I have a directory called apps/myapp/ with a file myapp.exe which uses myapp.dll and some other dlls.

Now lets say i want to symlink this to a directory, like one would do in linux.

bin/myapp.exe => verylongpath/myapp/myapp.exe. Ie using mklink bin/myapp.exe verylongpath/bin/myapp.exe

Now when i run the myapp, it's yelling against me that it can't find the dll. which means that the exe isn't run against its own working directory. Which makes me sad.

Is there somehow i can make it run in ints own working directory? Thanks!

Best Answer

You can create myapp.bat (instead of a link) and write below command into it:

call "absolute\path\of\your\excecutable" %*

Example:

@call "C:\Program Files (x86)\GnuWin32\bin\openssl.exe" %*

Save above lines in openssl.bat everywhere you need a shortcut.

Related Question