JSLover wrote:
without [an explicit exe file] AHK can't find the pid
This is a documented limitation: "The variable will be made blank if the PID could not be determined, which usually happens if a system verb, document, or shortcut is launched rather than a direct executable file."
Since I don't know any way to improve on it yet, the script would have to discover the PID some other way, such as WinGet.
JSLover wrote:
the only way to make it happy (in both cases) is like I did with the "iffy" space addition...can this be improved at all?
It could be improved by omitted whitespace when passing the command line to the API for launching. However, I think this would break any script that relies on the ability to launch files whose names start with spaces.