Windows symlink to executable - does not open by double click

On Windows 7 I created a symbolic link to an executable using:

mklink Test.exe C:\Path\to\source.exe

But when I try to run it by double clicking on it, i get the "open with" dialog.

Running it from a command window works. The path is right.

Is there any way a symbolic link will be treated like the file it points to (e.g. executable or batch scripts)?


Solution 1:

Windows symlink to executable does not open when double clicking

A recent Windows 7 Update KB3039066 broke symbolic links in Windows Explorer and other programs that use the services provided by the Windows shell.


Fix

The problem is solved by uninstalling the following update on both the file server and a client computer: KB3039066.

After uninstalling it you must restart the PC.

Source: Symbolic link type changed


Workarounds

  1. Use a hard link (mklink /h)
  2. System restore to an earlier date.

Same problem here. And yeah, I have installed something: the latest Windows update. I know that's the cause, because I noticed the problem on one computer. Then checked on a different one, and no problem there. I immediately applied Windows update to the second machine, and... bam! Explorer no longer resolves symbolic links.

...

With a System Restore to a earlier date, I was not able to duplicate this issue, thus I can positively confirm that there currently stands a bug with regards to Symbolic Link behaviour in Windows Explorer, introduced after a recent Windows 7 update.

As a work-around for now: if you would like to navigate to a linked file through Explorer, and you require a programme to access that link, consider using a Hardlink.

Source Windows 7: Windows Explorer does not follow Symbolic Links


Further Reading

  • An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.
  • mklink - Create a symbolic link to a directory or a file, or create a hard file link or directory junction.

Solution 2:

David’s answer is not the whole solution for EXE files. Removing update KB3039066 does fix the thumbnail images for symlinks.

However when you double-click the link in Windows Explorer, the link cannot be opened, and you receive an error message that resembles the following:

The specified path does not exist.

This is fixed by installing update KB3009980. Thanks go to this forum post.

Note you can download the hotfix here if you do not want to have Microsoft email it to you.

Ironically, KB3009980 breaks the “Extra Large Icons” and “Large Icons” for symlinks of JPG files.