How to run a Window command repeatedly forever

By | September 20, 2015

Say, you want to run the command “echo Hello, World” repeatedly forever. A goto command can be used to create a forever loop.

Using ping here is to add 5-second sleep in the loop since there is no built-in command for sleeping. A little sleep may be required in order to break the execution if necessary. If the command to be run throws an exception, the script will stop. To ignore exceptions and continue the loop, we can run the command usingĀ start.

Leave a Reply

Your email address will not be published. Required fields are marked *