Old School: Loop with a Sleep

Wanna loop through something indefinitely? With a built-in sleep between iterations?

Within a .bat file:
:loop
shutdown /a
net start "service"
TIMEOUT /T 10
goto loop

Within PowerShell:
$i = 1
Do
 {
  shutdown /a
  net start "service"
  TIMEOUT /T 10
 } 
While ($i -eq 5)

No comments:

Post a Comment