Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to schedule a task X minutes after Windows Server 2003 starts?

In "Scheduled Tasks" one can specify "When my computer starts" but I see no way to specify delay.

What I am trying to achieve: there is a service (JIRA) that even though dependent on SQL Server service still doesn't wait long enough for SQL Server to become fully operational. So JIRA service fails to connect to the database and needs to be restarted manually after each server reboot. My plan is to add "SC stop" and "SC start" commands for JIRA service 3 minutes after server starts.

share|improve this question
up vote 2 down vote accepted

In your batch file with the sc.exe command just wait for x minutes before running sc.exe.

I don't remember if 2003 has something native for this, but there is always 'sleep.exe' in the Windows Server 2003 Resource Kit:

sleep.exe 180
sc.exe start...

waits for 3 minutes

share|improve this answer
The native utility is timeout. – jscott Jun 2 '12 at 20:56

In Powershell one can use this to sleep 10 seconds:

Start-Sleep -s 10

share|improve this answer
I would not use Powershell in this case, it loads the dot.Net runtime which is a lot of overhead just for waiting a little bit. – Peter Hahndorf Jun 2 '12 at 21:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.