Solving development problems  |  About this blog

Archive for the ‘dos’ 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

How to delete all files and subdirectories recursively from one directory using DOS command?

Use DOS command to delete all files and subdirectories from specific folder (directory) – you must not be in this folder when executing this command:

rmdir /s /q "c:\Temp\Your-Dir-With-Subdirs"
Create this directory (folder) again because it will also be deleted
md "c:\Temp\Your-Dir-With-Subdirs"