User Tools

Site Tools


mgenay:technique:delay_in_windows

For some reason, there is no way, in windows, to delay the execution of a script or a program (especially on startup, even if it's handle a little better by Windows 7). This script is to run using, for instance :

path:\to\delay.bat 10 path:\to\the\other\program.exe arguments

delay.bat
@mode con: cols=80 lines=3
@echo delaying the start of %~nx2 by %1 seconds
@ping -n %1 127.0.0.1 >nul
@shift
@shift
@set cc=%0
@shift
:buildup
if .%0. == .. goto doit
@set cc=%cc% %0
@shift
@goto buildup
 
:doit
start "" %cc%

This script can be used on any version of windows : windows 95, windows 98, windows NT, windows XP, windows ME, Windows 2000, Windows 7, Windows 2003, Windows 2008, and next…

mgenay/technique/delay_in_windows.txt · Last modified: by 127.0.0.1