2

It's pretty self-explanatory, what I'm trying to do here. When I do something like this:

set n=0
:choose
set /a n+=1
choice /c yn
if errorlevel 2 ( echo NO! >>log.txt
) else echo YES! >>log.txt
if %n% lss 10 goto choose

The loop executes produces a new line for each time the command is executed (10 times=10 lines) I want it to write all 10 outputs to one line in the log.

1 Answer 1

4
set n=0
:choose
set /a n+=1
choice /c yn
if errorlevel 2 ( echo|set /p=NO! >>log.txt
) else echo|set /p=YES! >>log.txt
if %n% lss 10 goto choose
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.