Windows 7 – Executing Symbolic Link to EXE Error

symbolic-linkwindows 7

When trying to execute a symbolic link which points to an exe file (on Windows 7), the "Open with" windows appears. When renaming it to a ".exe" file, it says "The specified path does not exist. Check the path, and then try again.". Symlinks to other destinations seem to work fine.

So is there any way to execute a symlink?

EDIT: In the command prompt, I execute the following and the MyProgram.exe runs both times. However, if I double-click on the symbolic link in Windows Explorer it fails with the above error message.

C:\Temp>mklink SomeProgram.exe MyProgram.exe
symbolic link created for Backup.exe <<===>> Backup-1.0.1.exe

C:\Temp>SomeProgram.exe

C:\Temp>del SomeProgram.exe

C:\Temp>mklink SomeProgram.exe C:\Temp\MyProgram.exe
symbolic link created for Backup.exe <<===>> C:\Temp\Backup-1.0.1.exe

C:\Temp>SomeProgram.exe

Best Answer

Since the only other answer doesn't really "fix" the issue, just acknowledges it, I think it's worth saying I had this same issue, and discovered the problem.

The issue for me was relative vs absolute symlinks. I use Link Shell Extension.

When creating absolute symlinks, Explorer works fine. When creating relative links, Explorer chokes on them.

I can only guess that this is somehow related to how Explorer calculates the working directory? Maybe some slash problems?

(Note that on Win7 x64, at least, you may have to open LSEConfig.exe after installing the extension, and toggle Absolute and then Relative to get it to make relative links, as the default config is somewhat unpredictable, sometimes relative, sometimes absolute.)

Related Question