Delay Start Script for application.exe

Posted on 2011-04-27
Last Modified: 2012-05-11
I would like to create a startup script for a couple workstation, to auto start an application but have it a delayed start for 30 seconds or be able to change for custom fit per server. The applications rely on a few services that take a while to start. I would like some kind of a script any help would be appreciated!!
Question by:k_hoffhines
    LVL 25

    Expert Comment

    by:Ron M
    LVL 25

    Expert Comment

    by:Ron M
    ...sorry..not wscripts

    LVL 25

    Accepted Solution

    vb script..

    set WshShell = WScript.CreateObject("WScript.Shell") "c:\yourprogram.exe"
    LVL 82

    Expert Comment

    Here's a batch script that will check a configurable list of services and only start the application (in the background) once all services are up and running.
    A log file is created in the the temp folder (when running as startup script usually in %Systemroot%\temp, when started as user for testing in %Temp%).
    Note that a startup script has a default timeout of 10 minutes, after which it will be kicked out, done or not, but that should be enough in your case.
    @echo off
    set DependList="Java Quick Starter" "Alerter"
    set LogFile=%Temp%\%~n0.log
    >"%LogFile%" echo %Date% %Time% Waiting for services: %DependList%
    set AllStarted=1
    for %%a in (%DependList%) do (
      net.exe start | find /i "%%~a"
      if errorlevel 1 (
        >>"%LogFile%" echo %Date% %Time% Not started yet: %%a
        set AllStarted=0
      ) else (
        >>"%LogFile%" echo %Date% %Time% Running: %%a
    if %AllStarted%==0 (
      sleep.exe 5
      goto Loop
    >>"%LogFile%" echo %Date% %Time% All services running, starting application
    start "" "T:\he\application.exe"
    >>"%LogFile%" echo %Date% %Time% Done.

    Open in new window


    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT ( The crux of this batch f…
    This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    729 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

    21 Experts available now in Live!

    Get 1:1 Help Now