What is wrong with this code? It says ECHO is off
.
@ECHO off
set /p pattern=Enter id:
findstr %pattern% .\\a.txt > result
if %errorlevel%==0 (
se
If your variable is empty somewhere, it will be the same as having the command "echo" on its own, which will just print the status of echo.
To avoid this, you should replace all your echo
commands with something like this:
echo var2: %var2%
That way, if %var2%
is empty it will just print "echo var2:" instead of "echo off".