The below script opens a file at a specific time via AHK. If the computer is off at that time, what should be the way to run this script ?


SetTimer, CheckTime, 5000

TheTime = %A_Hour%%A_Min%
If (TheTime = 1525) && !(Ran)
    Run, C:\Test.txt
    Ran := 1
  • You could schedule the computer to wake-up if it's asleep at the schedule time. I've done similar things by scheduling a dummy .bat file to run at desired time using the Scheduled Tasks control panel. There may be some way to do the scheduling from AHK, but I've never looked into it.
    – martineau
    Nov 28, 2013 at 20:39
  • P.S. When you create a task with the Scheduled Task Wizard, there's an option to "Open advance Progrerties for this task when I click Finish" at the end. If you check it, a new dialog will open, and you can enable the "Wake the computer to run this task" option on the Settings tab within it.
    – martineau
    Nov 28, 2013 at 20:55
  • Here's an example of creating a scheduled task from within AHK.
    – martineau
    Nov 28, 2013 at 21:06
  • it has a lot of stuff. can you direct me to the proper script?
    – AMDG
    Nov 29, 2013 at 23:00
  • There's only one script. It's a little long because it has a GUI. Unfortunately I don't have one of the required versions Of Windows (Vista, 7, or 8) to run it myself.
    – martineau
    Nov 30, 2013 at 1:10


You must log in to answer this question.

Browse other questions tagged .