How can I set the duration of a scheduled task using schtask in WinXP?

Dear Experts,
I'm writing a command line batch that create a scheduled task. I can't use the GUI because I need to implement this batch to run on the remote computers of my company.
This task runs starting from 11:00 am until 19:00, every 2 hours.

My OS is Windows XP.
I used also in the past the easy command "schtasks". The problem is that I'm not able to set the duration of my scheduled task (all the other settings are not so difficult).
The problem is that the /DU option (to set the duration of the scheduled task) is no more available in WinXp (I guess most of you will answer me that this is actually the answer to my question ;-) ).
By the way, I really appreciate if you have an answer to my question! Maybe you know a way to set this parameter using a vb script....

I really don't believe that this parameter, that can be easily set up using the GUI, can not be done via command line...or I should think that "Microsoft Strikes Back"? ;-)

thank you very much!!
schtasks /Create /RU SYSTEM /TN EXPORT /TR "c:\doExport.bat" /SC HOURLY /MO 8 /ST 11:00:00 /SD 01/09/2009

Open in new window

Who is Participating?
arnoldConnect With a Mentor Commented:
Can You RDP into the remote system?
You can use WMI to enable remote Administration.

Below is an example VBscript to create a scheduled task.

The duration you are talking about is the 2 hours i.e. you do not want the task run to start if the prior one did not finish?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.