Как в командной строке сделать бесконечный текст
Перейти к содержимому

Как в командной строке сделать бесконечный текст

  • автор:

How to create an infinite loop in Windows batch file?

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».

Looks like there are only for loops available and no while loops in batch. How do I create an infinite loop then?

6 Answers 6

How about using good(?) old goto ?

See also this for a more useful example.

Unlimited loop in one-line command for use in cmd windows:

enter image description here

A really infinite loop, counting from 1 to 10 with increment of 0.
You need infinite or more increments to reach the 10.

This could be useful if you need a really infinite loop, as it is much faster than a goto :loop version because a for-loop is cached completely once at startup.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *