Link to home
Start Free TrialLog in
Avatar of bemara57
bemara57

asked on

Windows SCHTASKS command line scheduler: create if task doesn't exist?

I have a scheduled task in a batch file like this:

SCHTASKS /CREATE /SC DAILY /ST 03:30:00 /TN "MySQL Backup" /TR %SCRIPTPATH%\Backup_MySQL.cmd /RU "NT AUTHORITY\SYSTEM"

Because I move this script from server to server, is there a way to first check if this task exists, then:

1.) If it does exist, to update the time of the scheduled task in case the time was changed in the batch script?
2.) If it doesn't then create it?
ASKER CERTIFIED SOLUTION
Avatar of JesterToo
JesterToo
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