0

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?

1 Answer 1

0

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

11
  • I just tried this and now neither of them appear in my Start menu. Rather confusing.
    – Pyroglyph
    Apr 28, 2019 at 13:19
  • Weird. Mine are still there. What version of Windows? I;m 1803 here. Apr 28, 2019 at 17:17
  • I'm on build 17763
    – Pyroglyph
    Apr 29, 2019 at 17:09
  • 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. Apr 29, 2019 at 19:59
  • $wshShell = New-Object -ComObject wscript.shell; 'StartMenu', 'AllUsersStartMenu' | %{gci "$($wshShell.SpecialFolders($_))*.lnk" -recurse | ?{($wshShell.CreateShortcut($_.fullName)).TargetPath -match 'myprogram'} | select fullname} Apr 29, 2019 at 20:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .