I'm trying to update the Raku code in this file which tries to find the path to commands/apps on a Windows machine.
I have a Windows 11 machine running inside VirtualBox. wordpad.exe
cannot be run from the command line because it is not in the $PATH
, and so the code will also fail to detect wordpad.exe
in the path. As a fallback, the Raku code attempts to find the executable in the registry using the Windows API via the NativeCall
module. However, this is also failing to find the wordpad.exe
command.
Looking at the registry, there is a WORDPAD.EXE
entry in the registry at Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WORDPAD.EXE
. It shows a path of "%ProgramFiles%\Windows NT\Accessories\WORDPAD.EXE"
.
I did a little googling, and this is how paths to some executables are stored. However, I was not able to figure out how to use the Windows API to find and extract the path to the app. I'm also unclear as to why the current Raku code uses the AssocQueryStringA()
function.
Some hints are dropped in this SO answer.
But, never having done Windows API programming, and only knowing basic C programming, I'm a little at a loss.