Can JScript test whether a programme alias is valid?

Windows 10 routinely uses aliases for programmes, which nicely avoids the need to use paths for an EXE or LNK file in a DOpus button or the Run Box. For example:
Firefox launches Firefox.
Winword launches Microsoft Word
Notepad C:\Windows\WindowsUpdate.log opens the file for editing by Notepad

But a word that is not a valid alias, such as Firefoxxx, throws an error.

QUESTION: Can JScript test whether a given word is a valid programme alias? Obviously Windows knows, and so does WinAero's Win-R Alias Manager! This test would allow the prevention of inelegant errors being thrown by an addin script function.

(For example, the software may be installed on one computer, but not on another network computer using the same backed-up-and-restored DOpus configuration).

Are we talking about typing into the Start Menu?

I think that works by the Start Menu searching the names of shortcuts inside the /start and /commonstartmenu folders. You could do the same from a script if you wanted to, but it would not always give the same results as I don't think there is any way to use the exact algorithm that the Start Menu uses (which is subject to change anyway).

Edit 2 / Edit 3: Winword does not work for me, that's because I don't have Word installed. Wordpad works OK.

No, these are programme aliases. They have nothing to do with typing into the Start Menu, or indeed with the Start Menu.

A DOpus button with the single line:
Firefox
will open Firefox. A DOpus button with the single line
Notepad C:\Windows\WindowsUpdate.log
will open that file in Notepad. And similarly when these line are typed into the Run Box.

Many, or most, installed programmes create such a programme alias during the installation process. Other random examples are:
UEStudio for UltraEdit studio
IExplore for Internet Explorer
mplayer2 for Windows Media Player.

WinAero’s Win-R Alias Manager lists them all, (and allows the user to create more, but that's a bit non-standard). My system currently has 58 such aliases.

They are all stored somewhere in the Registry, I think, but even I knew where, I don't know the JScript commands to view those registry entries. What I am trying to do is test within JScript whether a particular word is a valid programme alias. (WinAero's tool unfortunately doesn't allow its list to be saved, so it's not useful for checking.)

Have a look below HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths

You can resolve things like {apppath|mplayer2} using FSUtil.Resolve in an Opus script to see if they point to a path, and then if the path still exists. (Although that gives you the parent dir, not the exe path. The exe path is in the registry as well, so you could get that via a script as well, I guess. Or just add on the known exe name to the result, but note it isn't always the same as the AppPath name: There is no mplayer2.exe on disk, it's called mplayer.exe now.)

  1. I've found those registry entries, plus a few more at the same sublocation in HKEY_CURRENT_USER.

  2. I've also learnt now how to return the path to the parent directory from within the script by using the command
    DOpus.FSUtil.Resolve ({apppath|myappname})
    (no quotes around the appname, and the inclusion of .exe seems optional).

  3. I have found further that if the alias/apppath is invalid, then this command just returns the original input string {apppath|myappname}. Because all I want to do is find out whether the alias/apppath is valid, I only need to check whether the returned string is the same as the input string.

This has solved my original question with about two lines of code! Thank you very much, Leo.