Shortcuts to different executables of the same name do not appear in the Start Menu

1

I have 2 versions of a program installed, the stable and beta versions. The executable name for each is shared.

Example:
Stable: C:/some/path/program.exe
Beta: C:/some/other/path/program.exe

Shortcuts to both executables have been made and placed into %APPDATA%\Microsoft\Windows\Start Menu\Programs with different names.

This should mean I am able to see a shortcut to both versions in the Start menu, but that's not what happens. Instead, only the first shortcut appears in the list. Renaming the shortcut file that is missing from the list to something that would alphabetically place it before the other causes it to appear instead.

Here's another example to help illustrate:

If these exist in the Start Menu\Programs folder:
Program.lnk
Program Beta.lnk

Then only this will appear in Start:
Program

HOWEVER

If these exist in the Start Menu\Programs folder:
Program.lnk
aaaProgram Beta.lnk

Then only this will appear in Start, because it alphabetically precedes the other:
aaaProgram Beta

My question is, how do I get both shortcuts to appear in the Start menu?

Pyroglyph

Posted 2019-04-26T09:43:19.963

Reputation: 154

Answers

1

Create a symbolic link to one of the executables and give it a different name.

  1. Launch an Administrative Command Prompt window (not PowerShell).
  2. Type mklink /? for help. It's pretty simple:
C:\Users\keith\Standalone Programs\DB Viewer\SQLiteDatabaseBrowserPortable>mklink /?
Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target

        /D      Creates a directory symbolic link.  Default is a file
                symbolic link.
        /H      Creates a hard link instead of a symbolic link.
        /J      Creates a Directory Junction.
        Link    Specifies the new symbolic link name.
        Target  Specifies the path (relative or absolute) that the new link
                refers to.
  1. I tested with the standalone program "SQLiteDatabaseBrowserPortable.exe":
C:\Users\keith\Standalone Programs\DB Viewer\SQLiteDatabaseBrowserPortable>mklink dbv.exe SQLiteDatabaseBrowserPortable.exe

Then created a folder under shell:programs with shortcuts to both executables. Both showed on the Start Menu: enter image description here Don't know why the second icon is weird but assume that could be over-ridden by editing the shortcut.

Keith

EDIT: Here's the formatted PowerShell Code to search the Start Menu shortcuts based on the Target path:

$wshShell = New-Object -ComObject wscript.shell
'StartMenu', 'AllUsersStartMenu' |
   %{
      gci "$($wshShell.SpecialFolders($_))\*.lnk" -recurse |
         ?{($wshShell.CreateShortcut($_.fullName)).TargetPath -match 'myprogram'} |
            select fullname
   }

EDIT 2: Here is the original executable and the symlink created to "rename" it:

C:\Users\keith\Standalone Programs\DB Viewer\SQLiteDatabaseBrowserPortable>dir *.exe
 Volume in drive C is Windows
 Volume Serial Number is F057-590D

 Directory of C:\Users\keith\Standalone Programs\DB Viewer\SQLiteDatabaseBrowserPortable

04/26/2019  06:34 PM    <SYMLINK>      dbv.exe [SQLiteDatabaseBrowserPortable.exe]
09/26/2017  05:13 PM           176,944 SQLiteDatabaseBrowserPortable.exe
               2 File(s)        176,944 bytes
               0 Dir(s)  697,830,395,904 bytes free

Here are the shortcuts and their targets: enter image description here

Keith Miller

Posted 2019-04-26T09:43:19.963

Reputation: 1 789

I just tried this and now neither of them appear in my Start menu. Rather confusing. – Pyroglyph – 2019-04-28T13:19:45.073

Weird. Mine are still there. What version of Windows? I;m 1803 here. – Keith Miller – 2019-04-28T17:17:15.190

I'm on build 17763 – Pyroglyph – 2019-04-29T17:09:27.110

17134.706 here. But let's try some troubleshooting. Given the behavior of the Start Menu, let's check for shortcuts that might have the same target. The following comment is a PowerShell one-liner. Copy and paste into PowserShell and see what paths are returned. You'll have to edit the match string as you don't provide an actual executable name. – Keith Miller – 2019-04-29T19:59:33.677

$wshShell = New-Object -ComObject wscript.shell; 'StartMenu', 'AllUsersStartMenu' | %{gci "$($wshShell.SpecialFolders($))*.lnk" -recurse | ?{($wshShell.CreateShortcut($.fullName)).TargetPath -match 'myprogram'} | select fullname} – Keith Miller – 2019-04-29T20:02:14.353

I get back these 4 lines: C:\Users\[me]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Blender Beta.lnk C:\Users\[me]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Blender.lnk C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Blender Beta.lnk C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Blender.lnk – Pyroglyph – 2019-04-30T20:23:54.483

I'd delete them all and then try adding recreating just one. You did create a junction with a .exe extension to rename the beta version, right? Are the targets different for the shortcuts? If you matched on 'Blender', that would match on both 'Blender' & 'Blender Beta' – Keith Miller – 2019-04-30T21:15:18.180

After deleting them all and starting again, I did some testing and found out that symlinks just don't show up in the Start menu at all. And I'm not sure what you mean by create a junction with a .exe extension to rename the beta version, aren't junctions for directories? The targets for the shortcuts are entirely different apart from the executable name, which is the same. – Pyroglyph – 2019-05-01T15:18:18.713

Also, if I rename one of the exe files to something else and update the shortcut it works, but it'd be annoying to have to do that every time the software has an update. It looks to me like the Start menu itself is saying "oh, these 2 shortcuts have the same executable name, so they must be the same" despite the fact that they and their paths are completely different. – Pyroglyph – 2019-05-01T15:23:05.670

My apologies, it is a symlink and not a junction, but for me, the symlink works fine as the target of a shortcut, and subsequently, that shortcut works in the Start Menu. I'm going to edit my post to show formatted output & screenshots. – Keith Miller – 2019-05-01T15:45:15.177

Since symlinks and shortcurs just don't seem to be working properly on my machine, I've ended up just creating a batch script that launches one of the executables and pointed one of the shortcuts to that instead of the executable itself. This workaround seems to be the only option that actually works for me. I appreciate the effort you've put into helping me though. – Pyroglyph – 2019-05-02T13:28:23.603