Link to home
Start Free TrialLog in
Avatar of malcolm29
malcolm29Flag for United States of America

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.
SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The default behaviour is not to run on creation or modification, so I agree to arnold.
Avatar of malcolm29

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!
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The MS doc has several examples it all depends on what it is you are changing.