• shortcuts to executables

    Home » Forums » AskWoody support » Windows » Windows 10 » Questions: Win10 » shortcuts to executables

    Tags:

    Author
    Topic
    #1596601

    I’m in the process of getting my new win10 system set up (pro/64) and I can’t get shortcuts-to-executables to work.  One thing I’ve done [on many OS’s!] for a long time is use shortcuts [or symlinks, as appropriate :)] to executables.   What I do, for example, is when I have “prog-v12.exe” I link to it from “prog.exe” and now the programs the use “prog” can do so without having to know which version I have installed [when prog-v13.exe appears, I just change the link and all of my programs work perfectly].   I have used this all over my win7 system.

    My problem is that I can’t get it to work on win10.  I have it set up, and when I double-click on the shortcut it runs the program just fine.  But when I try to run it from a command prompt I get the “‘prog’ is not recognized as an internal…” error.

    One thing I tried doing, but I think it is dangerous so I’m probably going to undo it, is to add “.lnk” to the PATHEXT environment variable and I was surprised that that partly works: I can now do “prog.exe” and it finds the link and runs the program, but “prog” still doesn’t work.

    I’m tempted to try adding “.exe.lnk” to PATHEXT as see if that works, but that feels pretty wrong.  If it does, and it is the only way, then I’d also end up adding “.bat.lnk” and “.pl.lnk” and …etc.  Which I guess I could do, but surely there must be a simpler, more-elegant way to get this to work.

    Viewing 3 reply threads
    Author
    Replies
    • #1596709

      Would the executable be from a portable program?
      If so, it may be that the program needs to be on a different partition/usb flash or SDcard opposed to the Windows drive to work. Some do work on the windows partition, some don’t in my experience.

      If debian is good enough for NASA...
    • #1596717

      Alas not — I have run into that problem before [on my win7 system] but that’s not the case here.  I edited PATH to include D:\BIN and it is in that bin directory that I have both the shortcut and the executable

    • #1596741

      Have you tried creating the shortcut as per the windows default naming convention (without changing the name) and then running from the cmd prompt? my thinking is that it may be an integrated w10 safety/security feature against malware.

      If debian is good enough for NASA...
      • #1597427

        I’m not sure what the defaults and such are.  What I usually do is create a shortcut via drag in Explorer, “create shortcut”.  That gets me “prog-v##.exe” as the shortcut name, but pointing to the right thing, then I just rename it to “prog.exe”.

        I just tried it the other way: I did a right-click>new>shortcut.   I gave the the locationg [in my case, “d:\bin\prog-v##.exe” and the name “prog.exe”.  And, alas, it still didn’t work.  In fact the link itself didn’t work — that is I couldn’t even type “prog.exe” and get it to work after I removed .LNK from PATHEXT.

        I think the conclusion is that it is easiest if I just keep LNK in PATHEXT and then it is mostly OK.  I didn’t need to do that in win7, but such is life.   I’m not even going to bother trying putting “.EXE.LNK” in PATHEXT  🙂

        • #1597506

          then I just rename it to “prog.exe”.

          Try doing it WITHOUT this step, leave it at defaults and see if that works.
          Renaming could be causing the issue as for the reasons described in my previous post.

          If debian is good enough for NASA...
          • #1607997

            I haven’t checked that because that defeats the purpose of the exercise.   My goal is to be able to have a *generic* name for a program, even as the underlying program goes through multiple versions.  I’ve done this on various OS’s over the decades, including win7, and it has worked fine.  It appears that MS broke this functionality in win10.

    • #1618485

      Well, fortunately symbolic links are actually possible now. Try the “mklink” command. (And in Powershell, “New-Item -ItemType SymbolicLink”)

    Viewing 3 reply threads
    Reply To: shortcuts to executables

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: