Solving development problems  |  About this blog

Archive for the ‘batch file’ tag

SLEEP/WAIT command in BATCH file

The most popular way to do it is by ping:

ping 1.1.1.1 -n NumberOfRetries -w TimeToWaitBetweenTries

so that it waits for approximately (NumberOfRetries) multiplied by (TimeToWaitBetweenTries) milliseconds.

If you want to suppress the output to the screen, just redirect it like this:

ping 1.1.1.1 -n 3 -w 1000 > null

Written by Avivo

December 17th, 2010 at 2:42 am

Kill a process from BAT (batch) file

Just put this command with name of your process:

taskkill /F /IM MyProgram.exe

Written by Avivo

June 4th, 2009 at 2:49 pm