I have a sched task that I authored using my user account that I know from running manually works. The problem I'm having is that at some point Windows 7 is deleting and recreating this task, and doing it incorrectly. Consequently the task won't run at its scheduled time.
The most important change it is making is that it's setting Run As user to SYSTEM instead of my user account. I know this won't work this way from manual runs.
Looking at the task history I can see what Windows 7 is doing, I just don't know why, or how to stop it. Every time I create this task Windows will eventually go through this sequence of events, resulting in a task that is different than the one I created:
I do have another task that works fine, and Windows leaves alone. It is configured the same way, except it's a simple "shutdown -s -t 60". So maybe it's a UAC thing with Ad-AwareAdmin.exe?
I don't think so. I'm just using Win 7 Task Scheduler, which I think uses schtasks.exe under the hood. I'll Google at.exe to see if it's something I can use instead.
I'm creating a task to do an Ad-Aware scan with these parameters (and Windows makes these changes):
General
---Run as <myDomain>\<myUser> (changes to SYSTEM)
---Run only when user is logged on (changes to logged on or not)
---Run with highest privs OFF (changes to ON)
Triggers
---Daily at 3am
Actions
---Start a program
---C:\Program Files (x86)\Lavasoft\Ad-Aware\Ad-AwareAdmin.exe scan "Smart Scan"
Conditions
---Stop if ceases idle ON
---Start if on AC power ON
---Stop if battery ON
---Wake ON (changes to OFF)
Settings
---Allow on demand ON
---Stop if runs longer than 3 days ON
---Force stop ON
I do have another task that works fine, and Windows leaves alone. It is configured the same way, except it's a simple "shutdown -s -t 60". So maybe it's a UAC thing with Ad-AwareAdmin.exe?