Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question
    
Yes, Windows 7 supports NTFS symlinks in the form of the command mlink. Did you search? :) superuser.com/questions/234422/… –  Moses Feb 22 '13 at 18:39

1 Answer 1

What you will likely need to do is symbolically link the folder containing your application binaries rather than just the EXE file itself. The most compatible way to make a directory symbolic link in Windows is use their junction points.

Use this command:

mklink /J ..\link\target\dir linkdirname

Paths to the target can be relative to the current location. You don't need to start from the drive letter.

Once this is done you should be able to CD into your linkdirname and run your application as normal.

FYI: You could use the /D option for a directory symbolic link, but in my experience I've found junction points to behave in a much nicer (and more compatible) way. Some applications aren't fooled by directory symbolic links, but happily work with junctions. For example, in Steam, I can re-route game folders using junctions, but not with directory symbolic links.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.