Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to execute one line multiple times using Windows batch file?

Tags:

batch-file

Below is my requirement.

@echo off
cls
Set Sleep=0
:start
echo This is a loop
xx.exe yyyyy.dll /p:InputDataSource=Table:table.xml
Set /A Sleep+=1
echo DisplayingSleepvalue
echo %Sleep%
goto start

Here I want to execute xx.exe yyyyy.dll /p:InputDataSource=Table:table.xml this line for 30 times.... Could any one please help me on this.

Thanks,
Manasa

like image 680
Manasa Manthri Avatar asked Apr 09 '12 12:04

Manasa Manthri


1 Answers

Try this way:-

@echo off
cls
Set Sleep=0
:start
if %Sleep% == 30 ( goto end )
xx.exe yyyyy.dll /p:InputDataSource=Table:table.xml
echo This is a loop
Set /A Sleep+=1
echo %Sleep%
goto start
:end
echo "am 30 now"
pause
like image 107
Siva Charan Avatar answered Oct 08 '22 08:10

Siva Charan