lundi 24 mai 2021

How can I use multiple words in an if statement in batch?

Im using the if statement to take user input. Im just trying to get the input @echo off, but it doesnt seem to be working. I am using the code below, but everytime I enter "@echo off" the window closes immediately. What can I do to fix this?

@echo off

echo type @echo off

set answer=@echo off

set /p question=

if %question%==%answer% goto good

echo no

pause

exit

:good

echo good

pause

Aucun commentaire:

Enregistrer un commentaire