I wrote a batch script to get a yes or no from the user. And it works. But when I put all into one line with & between the commands, it no longer works.
Here is the working script:
@echo off
set /p Input=continue?
if "%Input%"=="n" exit
@echo continue
PAUSE
and here is the not working script:
@echo off & set /p Input=continue? & if "%Input%"=="n" exit & @echo continue & PAUSE
This one doesn't work, either.
Setlocal EnableDelayedExpansion & @echo off & set /p Input=continue? & if "!Input!"=="n" exit & @echo continue
Nor this one:
@echo off & set /p Input=continue?
if "!Input!"=="n" exit & @echo continue
I have an update: If I make a new line, the second script works. But it's not where one might expect.
@echo off & set /p Input=continue? & if "%Input%"=="n" exit
@echo continue & PAUSE