john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

BAT watch timed loop command as parameter

@ECHO OFF
:loop
  %*
  timeout /t 5
goto loop



watch.bat  dir

will run the given command every 5 seconds

REM HARD CODED VERSION  , alternate timer ping 1.1.1.1 -n 1 -w 5000 >NUL
@ECHO OFF
:loop
  dir
  timeout /t 5
goto loop

  • « Report StorageGateway v2
  • JohnStringUtils »

Published

Oct 5, 2012

Category

bat-vbs-perl

~40 words

Tags

  • as 12
  • bat 22
  • bat-vbs-perl 51
  • command 29
  • loop 9
  • parameter 6
  • timed 1
  • watch 2