I'd like to have a directory, add it to my PATH, and put shortcuts to executables in it. I've done it in a Linux and it worked so wonderfully, but it doesn't seem to work on Windows -- it just can't find the file I'm trying to invoke.

Is there anything I can do? any setting to tweak? or is it impossible?

  • programmatically - yes. try to create shortcut. enter calc.exe as path. After that you will see in shortcut properties that windows done path resolution for it: Target: C:\Windows\System32\calc.exe – befzz Jun 30 '15 at 22:21

Just tried and it worked fine. Windows is slightly different as its shortcut has a default hidden "lnk" extension. So if you create a shortcut for "myprogram.exe", you need to rename the file to "myprogram" in Explorer, you can then invoke it using "myprogram" or "myprogram.lnk" from RUN dialog, or "myprogram.lnk" from command prompt.

Or you can create a symbolic link by mklink, in this way it should work exactly the same as(or at least very close to) in Linux

  • mklink almost works. where knows where the file is, but when I try to just call it: "The system cannot execute the specified program.". I noticed I can't run it from explorer like this too. Is there anything I can do to work that around? And I can't have a lnk extension since automated tools won't expect it. – MasterMastic Jul 1 '15 at 2:40
  • @MasterMastic Did you try a hard link mklink /h? – DavidPostill Jul 1 '15 at 8:24
  • @DavidPostill Solved it! thank you both very much. – MasterMastic Jul 1 '15 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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