Wednesday, October 6, 2010

How to Create, Modify and Delete Scheduled Tasks from the Command Line

We r generally uses task scheduling for performing some task at specified time without manually executed by us.

Sometimes it may require to Generate any task inside a batch file, so we r required to write the code in batch file to generate such task.

Here i m going to share some commands that will create , modify and delete such task...

Create ‘My Task’ to run C:\RunMe.bat at 9 AM everyday:


SchTasks /Create /SC DAILY /TN “My Task” /TR “C:\RunMe.bat” /ST 09:00

image

image





Modify ‘My Task’ to run at 2 PM:

SchTasks /Change /TN “My Task” /ST 14:00

image

image




Create ‘My Task’ to run C:\RunMe.bat on the first of every month:

SchTasks /Create /SC MONTHLY /D 1 /TN “My Task” /TR “C:\RunMe.bat” /ST 14:00

image

image





Create ‘My Task’ to run C:\RunMe.bat every weekday at 2 PM:

SchTasks /Create /SC WEEKLY /D MON,TUE,WED,THU,FRI /TN “My Task” /TR “C:\RunMe.bat” /ST 14:00

image

image




Delete the task named ‘My Task’:

SchTasks /Delete /TN “My Task”
image


No comments:

Post a Comment