views:

115

answers:

2

I'm trying to create a scheduled task (in WinXP) which runs every 10 minutes, starting at 16:00:00 to 06:00:00, daily, from the command line.

Currently, I can create a scheduled task which runs every 10 minutes, starting at 16:00:00, daily, by using the following command:

SCHTASKS.EXE /CREATE /SC MINUTE /MO 10 /TN "Scheduled task name" /ST 16:00:00 /SD 01/01/2000 /TR task.bat /RU SYSTEM

The question is, how do I modify the previous command so that it stops running at 06:00:00?

A: 

Since there doesn't appear to be a command line switch for the stop time of a particular task, I think the best you can do is try setting up a task for the allotted time that executes this:

schtasks /delete /tn "My Task" 

which should remove the task from the task scheduler, and cause it to stop executing. I haven't tried this myself, so I don't know if it kills kittens or not.

http://technet.microsoft.com/en-us/library/bb490996.aspx

Robert Harvey
A: 

After much searching, I could find no way to modify the scheduled task from the command line. As a work around, I pushed the responsibility of running the program every 10 minutes to my executable, leaving the scheduled task the sole responsibility of kicking off the program daily.

David