Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Windows Scheduler Issue


  • Please log in to reply
No replies to this topic
roberti9
  • Members
  • 5 posts
  • Last active: Apr 14 2015 07:09 PM
  • Joined: 26 Dec 2007

Just for info

I recently tried to get my compiled AHK to run from a Windows 7 scheduled task, but it kept failing to run.

I could run other compiled programs I had written OK.

 

This was driving me mad, until I looked into the script that was running, and the one that wasn't.

 

It turned out to be 3 lines of code missing at the begininning of script:

 

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

 

Inserted the above, and all ran as exspected.

Strange, I could run the program on it's own, but the scheduler wouldn't like it.

 

Now everything works fine.

 

I hope it might help other people.

 

Ian