为什么 AutoHotkey 响应 "System cannot find the file" 错误?

Why does AutoHotkey respond with a "System cannot find the file" error?

我是 AutoHotkey 的新手,不明白为什么这个脚本给我错误:

 Failed to launch program or document
 Action: <C:\Windows\System32\msg.exe>
 Params: <* "Initiated.">
 Specifically: The system cannot find the file specified.

这是我的 test.ahk 文件中的简单脚本:

Run, "C:\Windows\System32\msg.exe" * "Initiated."

我已经验证 msg.exe 文件在 c:\Windows\System32 文件夹中,我可以 运行 它没有脚本从命令提示符和单击msg.exe 程序。我还可以为 msg.exe 创建一个快捷方式并且它可以工作,但我不知道如何让 test.ahk 脚本文件看到它。

我以管理员身份尝试 运行ning 脚本(通过单击 test.ahk 文件),但出现相同的错误。

对于 32 位程序,该路径被重定向到 C:\Windows\SysWOW64

尝试将脚本中的路径更改为 "C:\Windows\SysNative\msg.exe"

或者更好的是,不要将非系统文件放在 OS 拥有的目录中。