How to create an infinite loop in Windows batch file?

前端 未结 6 2250
遥遥无期
遥遥无期 2020-11-28 02:50

This is basically what I want in a batch file. I want to be able to re-run \"Do Stuff\" whenever I press any key to go past the \"Pause\".

while(true){
            


        
6条回答
  •  无人及你
    2020-11-28 02:55

    Another better way of doing it:

    :LOOP
    timeout /T 1 /NOBREAK 
    ::pause or sleep x seconds also valid
    call myLabel
    if not ErrorLevel 1 goto :LOOP
    

    This way you can take care of errors too

提交回复
热议问题