AutoHotkey 如何确定仅使用 .exe 名称即可启动哪个可执行文件?

How does AutoHotkey determine which executable is launchable with a mere `.exe` name?

根据我的经验,#f::Run mailmaster 将在按下 #f 时启动 mailmaster.exe,但在按下 #f::Run QQMusic 时抛出:

我必须提供 QQMusic.exe 的完整路径,而我不必提供 mailmaster.exe 的完整路径。

根据the documentation

Run can launch Windows system programs from any directory. Note that executable file extensions such as .exe can be omitted.

Run notepad

因为mailmaster.exeQQMusic.exe都是非系统程序并且不是 包含在 Path 环境变量中 ,为什么 AutoHotkey 为它们提供不同的行为?

并且在性能方面,提供完整路径与仅提供 .exe 名称相比,哪个更快?

在文档中指定:

Target

A document, URL, executable file (.exe, .com, .bat, etc.), shortcut (.lnk), or system verb to launch (see remarks). If Target is a local file and no path was specified with it, A_WorkingDir will be searched first. If no matching file is found there, the system will search for and launch the file if it is integrated ("known"), e.g. by being contained in one of the PATH folders.

如果在 PATH 中找到它就差不多了。
例如,您可以通过在 cmd 或 powershell 中键入记事本、mailmaster 和 QQMusic 来尝试。在 PATH 中可以找到记事本,在你的系统上我假设也有 mailmaster,而 QQMusic 没有。
您应该得到与使用 AHK Run 命令相同的结果。

至于性能,我不知道,我想这是您可以进行基准测试的东西。
我猜想提供完整路径更有效率。
但是也许从 PATH 中找到一些东西在 Windows 方面得到了很好的优化,所以可能几乎没有区别。