I have a script that I have scheduled with Task Scheduler to run at log in/system start; however, I have noticed that the if condition I have set with A_TickCount always fails if I run the script after my computer has been shutdown for a few hours. When the script fails, if I restart my computer, it works, so it is clearly caused by A_TickCount being inaccurate after shutting down for a few hours. Example script:
Code: Select all
#NoEnv
SetWorkingDir %A_ScriptDir%
SetWinDelay, 1
#NoTrayIcon
if (A_TickCount < 300000)
{
MsgBox, Test
}
Edit:
QueryPerformanceCounter() value at boot
A_TickCount value at boot
The values are confirmed to not start from 0 at boot after a few hours of shutting down.