malcolm29
asked on
Modify a scheduled task without running it
It seems that when I use PowerShell's Set-ScheduledTask command (or the SchTasks command line utility) that the task runs immediately after being modified.
Is there a way to modify the task and NOT have it run immediately, but only run at its next scheduled time?
Thanks. Greg.
Is there a way to modify the task and NOT have it run immediately, but only run at its next scheduled time?
Thanks. Greg.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The default behaviour is not to run on creation or modification, so I agree to arnold.
ASKER
Thank you both. I was unable to determine where, using the new-scheduledtasktrigger or the set-scheduledtask commands, I could set the trigger as Arnond suggested. However, I did discover that if I modify an existing task that is set to run periodically, that if the start date and time are in the past that the task will trigger because it sees that the interval has passed. If I use new-scheduledtasktrigger to set the start date and time in the future, it does not run upon being changed.
If you can show me a command that can modify the trigger as you suggest, I will investigate that as well.
Thanks for you help!
If you can show me a command that can modify the trigger as you suggest, I will investigate that as well.
Thanks for you help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The MS doc has several examples it all depends on what it is you are changing.