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

点点圈 提交于 2019-12-22 08:10:17

问题


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.

Here is the simple script in my test.ahk file:

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

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.

I tried running the script (by clicking on the test.ahk file), as Administrator but get the same error.


回答1:


That path gets redirected to C:\Windows\SysWOW64 for 32-bit programs.

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.



来源:https://stackoverflow.com/questions/28798449/why-does-autohotkey-respond-with-a-system-cannot-find-the-file-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!