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

Posted on 2009-02-13
Last Modified: 2013-11-10
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

Question by:mgerosa
    1 Comment
    LVL 76

    Accepted Solution

    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?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Suggested Solutions

    Automatically creating a Trello card using data from a Microsoft Dynamics CRM record turned out to be an easy project that yielded great results.  Here's how I did this for an internal team at General Code.
    Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
    Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
    In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now