However error occurs when I execute scripts using cli with the command autohotkey.exe C:\Users\Administrator\Desktop\test.ahk. The content of test.ahk is as followings.
Code: Select all
#Requires AutoHotkey v2.0+
msgbox Test
I think that AutoHotkey.exe in AutoHotkey folder is for v1, not v2, which causing the issue.Error at line 1.
This script requires AutoHotkey v 2.0+.
Current interpreter: AutoHotkey v 1.1.37.01 Unicode 64-bit
C:\Program Files\AutoHotkey\AutoHotkey. exe
The program will exit.
So is there any way to execute AutoHotkey scripts that can automatically determine the version(or open a window to let the user determine the version) using cli?
I've searched the forum. However since my English is not good, I could only find this viewtopic.php?f=82&t=112096 similar to my issue. But I still don't know how to solve it. Additionally, I've also tried to install two versions via the fisrt method in https://www.autohotkey.com/docs/v2/Program.htm#install_v1 and autohotkey.exe has no effect in this case.
Can somebody help me? Thanks in advance!