为什么AutoHotkey响应“系统找不到文件"?错误? [英] Why does AutoHotkey respond with a "System cannot find the file" error?
问题描述
我是AutoHotkey的新手,无法理解为什么此脚本给我错误:
I'm new to AutoHotkey and cannot understand why this script is giving me the error:
Failed to launch program or document
Action: <C:\Windows\System32\msg.exe>
Params: <* "Initiated.">
Specifically: The system cannot find the file specified.
这是我的test.ahk文件中的简单脚本:
Here is the simple script in my test.ahk file:
Run, "C:\Windows\System32\msg.exe" * "Initiated."
我已经验证了msg.exe文件位于c:\ Windows \ System32文件夹中,并且可以从命令提示符处以及通过单击msg.exe程序来运行该脚本而无需脚本.我还可以为msg.exe创建一个快捷方式,并且该快捷方式有效,但是我无法弄清楚如何获取test.ahk脚本文件来查看它.
I've verified that the msg.exe file is in the c:\Windows\System32 folder and I can run it without the script from both a command prompt and by clicking on the msg.exe program. I can also create a shortcut for msg.exe and it works, but I cannot figure out how to get the test.ahk script file to see it.
我尝试以管理员身份运行脚本(通过单击test.ahk文件),但遇到相同的错误.
I tried running the script (by clicking on the test.ahk file), as Administrator but get the same error.
推荐答案
对于32位程序,该路径将重定向到C:\Windows\SysWOW64
.
That path gets redirected to C:\Windows\SysWOW64
for 32-bit programs.
尝试将脚本中的路径更改为"C:\Windows\SysNative\msg.exe"
Try changing the path in your script to "C:\Windows\SysNative\msg.exe"
或者更好的是,不要将非系统文件放在操作系统拥有的目录中.
Or better yet, don't put non-system files in directories owned by the OS.
这篇关于为什么AutoHotkey响应“系统找不到文件"?错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!