• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1299
  • Last Modified:

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!!
Marco
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

0
mgerosa
Asked:
mgerosa
1 Solution
 
arnoldCommented:
Can You RDP into the remote system?
You can use WMI to enable remote Administration.
http://blogs.msdn.com/ts/archive/2006/10/03/Terminal-Services-_2800_TS_2900_-Remote-Configuration-Primer-Part-1.aspx

Below is an example VBscript to create a scheduled task.
http://www.activexperts.com/activmonitor/windowsmanagement/scripts/operatingsystem/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?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now