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
Not sure, if this post is still read, but nevertheless.
You should try the following:
On top of the code right after @echo off
you have to put in
setlocal enabledelayedexpansion
Additionally anywhere you want to use variables changed in a block of brackets (like For-Loops
or If's
) you have to change the %
into !
to get
!varname!
This should be helping...
Greetings
geisterfurz007