Reputation: 1
I have 2 scheduled task say ABC and PQR,i want that if the scheduled task ABC is running then i want to stop it and run the scheduled Task PQR. if ABC is stopped then just run the PQR.
Upvotes: 0
Views: 177
Reputation: 56238
to check if a task is running:
schtasks /query /TN ABC
if %errorlevel%==0 echo ABC is running
to delete the scheduled task use
schtasks /delete /TN ABC
(maybe, you need an additional /F
(Force))
to create a scheduled task you need some parameters. See schtasks /create /?
.
If you have any more problems, please come back with the needed parameters and your "best try code"
Upvotes: 1