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.

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?

share|improve this question
    
Make sure your symlinks point to the right place - the target is relative to the link's location, not to the current directory when creating a link. (This bites *nix users often.) –  grawity Jun 29 '11 at 19:43
    
@grawity: Not true. Symlinks can use absolute as well as relative paths on *nix. Also, he mentioned Windows 7. –  Kurt Pfeifle Jun 29 '11 at 19:46
    
@pipitas: You're right that symlinks can use absolute paths (I never said otherwise), it's just that people often use ln -s ../../foo somedir/bar and get the wrong thing. || Symlinks work exactly the same way in both *nix and Windows. –  grawity Jun 29 '11 at 19:49
add comment

2 Answers 2

up vote 6 down vote accepted

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.)

share|improve this answer
    
I have LSE installed but where can I find LSEConfig.exe? –  laggingreflex Jun 27 '12 at 12:33
    
@laggingreflex - In the %ProgramFiles%\LinkShellExtension folder, or in the Link Shell Extension Start Menu folder. –  Unsigned Jun 27 '12 at 13:29
    
Ah I needed to install the latest version. It wasn't there before. –  laggingreflex Jun 27 '12 at 15:49
3  
Absolute links don't work any better than relative links for me under Windows 7 32-bit. At least not when made via mklink [absolutelink] [absolutetarget]. –  weberc2 Oct 10 '12 at 17:16
add comment

Works for me....

D:\Develop\DateTouch>mklink foo.exe TouchDate.exe
symbolic link created for foo.exe <<===>> TouchDate.exe

D:\Develop\DateTouch>foo.exe

How are you creating the symbolic link?


Edit:

enter image description here

  • Windows 7 Service Pack 1 applied?
  • 64-bit?

Edit: i see an issue:

C:\Users\ian.AVATOPIA>mklink foo4.exe c:\asdfasdf\adfasdf.exe
symbolic link created for foo4.exe <<===>> c:\asdfasdf\adfasdf.exe

So make sure your file actually exists.


Edit: i think i see your issue:

  • it launches fine from a command prompt
  • it fails to launch from Windows Explorer:

enter image description here

share|improve this answer
    
That's exactly what I'm doing. "mklink foo.exe c:\windows\system32\notepad-exe" or if notepad is in the current directory "mklink foo2.exe notepad.exe". When trying to open foo.exe or foo2.exe, I get said error message. Note that I can open the files with a text editor by replacing ".exe" with ".txt", so the target of the symlink is correct. –  basic6 Jun 30 '11 at 18:55
1  
YES, that's it! The holy Explorer refuses to execute symlinks, but the Windows command prompt and other file managers like muCommander don't. That solves my problem - thanks! –  basic6 Jul 1 '11 at 6:21
3  
Well it doesn't solve the problem; but it explains how to reproduce it. i couldn't find anything in process monitor that would hint why Explorer fails to launch it. i even wrote an application and call ShellExecute, and it launches fine. –  Ian Boyd Jul 3 '11 at 2:00
    
Downvote for failure to address actual issue. –  weberc2 Oct 10 '12 at 17:13
add comment

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.