I have V1 and V2 on the same W7 Pro 64-bit system. The V1 install is U32, done via the standard installer and, of course, using the AHK file extension for it. My V2 usage is via associating the AHK2 file extension with the V2 AutoHotkeyU64.exe file. The association of AHK2 with the V2 EXE file shows up in Control Panel>Default Programs and it works perfectly when I double-click an AHK2 script in my file manager. But when I put an AHK2 file in the Program/script field in the Action tab of a Task Scheduler job, it fails.
Here's a V2 script that shows the problem:
That works fine when running it from my file manager. But when I put this in the Program/script field of a Task Scheduler job:
Code: Select all
fileCurrentVersion:=A_Temp . "\AutoHotkeyCurrentVersion.txt" urlCurrentVersion:="https://autohotkey.com/download/2.0/version.txt" Download(urlCurrentVersion,fileCurrentVersion) MsgBox("Should be running V2","V2 Download")
I get this:
I think what's happening is that it's running V1, not V2, even though the file extension is AHK2.
Interesting to note that it works fine in Task Scheduler if I put this in the Program/script field:
And this in the arguments field:
Anyone know why D:\temp\v2test.ahk2 fails in Task Scheduler (apparently calling V1)? Thanks, Joe