How do I print the return value of a program in a loop in a batch file
script?
The task is to run a program(the same program) for ten times and output
for each run the exit code(the return value of the main function). So I
want to run a batch file(Windows), like this:
FOR /l %%x IN (1,1,10) DO (
AutomatedTest.exe cip.log
ECHO %ERRORLEVEL%
)
The code above should do it if you're thinking intuitively, but it doesn't
work because the code that it's running is actually:
(
AutomatedTest.exe cip.log
ECHO 0
)
and this piece is executed 10 times.
Any ideas on how to make it work? Thanks!
No comments:
Post a Comment