0

In windows command prompt, I run a command like this

program.exe all

and it prints out stuff as it runs, then ends. How can I basically do this?

while (1) {
    program.exe all
}

but in a way that I can still see it print out the stuff, and I can stop it by just doing ctrl+c.

Thanks

omega
  • 40,311
  • 81
  • 251
  • 474
  • Does this answer your question? [How to create an infinite loop in Windows batch file?](https://stackoverflow.com/questions/5487473/how-to-create-an-infinite-loop-in-windows-batch-file) – Squashman Jan 23 '20 at 04:39

1 Answers1

1
@echo off
:while
(
   program.exe all
   goto :while
)

which is equal to while(true).

maio290
  • 6,440
  • 1
  • 21
  • 38
  • is that a .bat file? – omega Nov 08 '19 at 23:35
  • also doesn't echo off, surpress the text output from the program.exe? – omega Nov 08 '19 at 23:35
  • Yes, it is a bat file. And echo off (which should be @echo off) just turns off the print of the commands from the batch file (see: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/echo) – maio290 Nov 08 '19 at 23:38