0

I am trying to read in the user input and then based on the character typed in trigger some function in batch. The issue is that when I run the batch file it runs the line to ask for the user input and then immediately runs the echo line to print out the value. Once the user has entered a value it then just says ECHO is on.

node -v >tmp.txt
findstr /c:"v1" tmp.txt >nul & if ERRORLEVEL 1 (
  set /p response=". . . Would you like to install NodeJS (Y/n)? ">answer.txt
  echo %response%
)

Output

adarian
  • 334
  • 7
  • 24

0 Answers0