News, tips, advice, support for Windows, Office, PCs & more. Tech help. No bull. We're community supported by donations from our Plus Members, and proud of it
Home icon Home icon Home icon Email icon RSS icon
  • shortcuts to executables

    Posted on berniec Comment on the AskWoody Lounge

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

    Tagged: 

    This topic contains 7 replies, has 3 voices, and was last updated by

     mn– 1 week, 5 days ago.

    • Author
      Posts
    • #1596601 Reply

      berniec
      AskWoody Plus

      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.

    • #1596709 Reply

      Microfix
      Da Boss

      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.

      ********** Peng/Wins x86/x64 **********

      - µfix

    • #1596717 Reply

      berniec
      AskWoody Plus

      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 Reply

      Microfix
      Da Boss

      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.

      ********** Peng/Wins x86/x64 **********

      - µfix

      • #1597427 Reply

        berniec
        AskWoody Plus

        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 Reply

          Microfix
          Da Boss

          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.

          ********** Peng/Wins x86/x64 **********

          - µfix

          • #1607997 Reply

            berniec
            AskWoody Plus

            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 Reply

      mn–
      Subscriber

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

    Please follow the -Lounge Rules- no personal attacks, no swearing, and politics/religion are relegated to the Rants forum.

    Reply To: shortcuts to executables

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