Delay a task in Windows?
March 23, 2006 11:03 AM   Subscribe

Does anyone know of a way to add a delay to a scheduled task in Windows XP?

I have a task that is set to run at logon, however I need several other programs to be loaded first, is there some way to add a delay to the task?
posted by Cosine to Computers & Internet (10 answers total)
 
Googling startup delay gives promising results, but I don't have firsthand experience with any of the software so I can't give recommendations.
posted by empyrean at 11:09 AM on March 23, 2006


Create a .bat file with the commands you want to run. At the top of the bat file, use a SLEEP command.
posted by skwm at 11:14 AM on March 23, 2006


Delay Run? (Second Google result for "Windows startup delay")
posted by kindall at 11:15 AM on March 23, 2006


If it's started through the Startup Items folder, you could move it out of there and start it manually.

If it's startable from the command line, you could make a batch file that calls it, and put the batch file in startup.

There doesn't seem to be a 'sleep X seconds' command in NT's DOS, so you'd probably have to do it with a PAUSE command... it will stop and wait for you to hit a key before continuing. Wouldn't work for unattended startups, though.

There's probably some kind of text-mode sleep command for NT out there. That might be the best solution.

On preview: skwn, XP doesn't have a SLEEP command, at least not out of the box.
posted by Malor at 11:16 AM on March 23, 2006


Response by poster: I understand several different ways of making a program delay itself before starting, I am asking about Windows Task Scheduler in particular, it is part of windows itself so doesn't start from the startup folder or a registry key that I can find. I am looking for a command line switch most likely that can be added to an individual task.
posted by Cosine at 11:26 AM on March 23, 2006


this is a total hack, but it will work. First, 'encase' your otherwise unmodified scheduled task in a batch file. Now, at the beginning of the batch file, insert the following line:
ping -n 10 127.0.0.1
This line will ping your local network interface 10 times. Since ping sends a packet every second, this will insert a 10 second delay. Tweak as necessary. When the ping is finished, the next line in your batch file will execute.

The drawback of this method is that you'll see the ping running in a command window. If you want to suppress the ping output, tweak the command like so:
@echo off
ping -n 10 127.0.0.1 > NUL
This will suppress all output, but you'll still get a blank command window.
posted by pmbuko at 11:43 AM on March 23, 2006


haha, pmbuko's answer rocks.
posted by delmoi at 11:57 AM on March 23, 2006


Response by poster: Thanks pmbuko, I thought of that too, just taking the task's command line, burying it in a batch file and putting some nonsense commands in to delay it, that's kind of my last resort as a more elegant solution would be preferable.
posted by Cosine at 12:11 PM on March 23, 2006


In the Settings tab for the scheduled task, there's a box that lets you tell Windows to start the task only when the computer has been idle for X minutes. Is that any use to you?
posted by flabdablet at 6:55 PM on March 23, 2006


I found a vbscript on this page (scroll down to or search for 'Startup Delay') that will do what you want.
posted by pmbuko at 8:00 PM on March 23, 2006


« Older How to keep myself on the cutting edge...   |   Help me save five months of memories? Newer »
This thread is closed to new comments.