1.

Solve : .bat file wait time?

Answer» HELLO everyone..

i want to create .bat file that executes shortcuts in time intervals of 20 seconds, and i have no idea how to set wait time. i've tried -t: 20 ; sleep 20 ;.. nothing works.

example

start 1.lnk
<--- ??!
start 2.lnk

many thanks for your help

stojko
Depending on what OS you have, you can use the CHOICE command in some versions of DOS and Windows 9x. Other versions of Windows can use the SLEEP command which may have come with the OS or can be downloaded in the appropriate RESOURCE Kit. In a pinch you can ALSO use the PING command.

Good luck. 8-)

SIDEWINDER has good suggestions. PING should already be in whatever OS you are using, so that can be used without having to download anything else. To use PING, your code would look like:
Code: [Select]start 1.lnk
ping -n 21 LOCALHOST >NUL
start 2.lnk
You use 21 instead of 20 because the first reply should be almost immediate, and then about 1 second between each of the rest.


Discussion

No Comment Found