Delay Start Script for application.exe

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!!
Who is Participating?
Ron MalmsteadConnect With a Mentor Information Services ManagerCommented:
vb script..

set WshShell = WScript.CreateObject("WScript.Shell") "c:\yourprogram.exe"
Ron MalmsteadInformation Services ManagerCommented:
Ron MalmsteadInformation Services ManagerCommented:
...sorry..not wscripts

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

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.