How to increment variable under DOS?

前端 未结 9 1648
清酒与你
清酒与你 2021-02-06 21:36

I\'ve spent the past 3hrs trying to work this out but just couldn\'t find a solution. Here\'s my batch script:

if NOT Exist Counter.txt GOTO START
Type c:\\count         


        
9条回答
  •  离开以前
    2021-02-06 22:17

    Directly from the command line:

     for /L %n in (1,1,100) do @echo %n
    

    Using a batch file:

     @echo off
     for /L %%n in (1,1,100) do echo %%n
    

    Displays:

     1
     2
     3
     ...
     100
    

提交回复
热议问题