To enter a string in a variable, you must concatenate the variable with the symbol =
and the value indicated by the string to be entered, in this way:
set /p variable=cadena
if you separate them, it will not work correctly.
This would be the way to find the word defined in serial
, in all the files with extension .txt contained in \server\Resultados\
, the results will save them in the file c:\lista.txt
:
@echo off
set /p serial=Escribe el Serial:
echo buscando: %serial%!
echo.
findstr /i "%serial%" \server\Resultados\*.txt >> c:\lista.txt
color 60
PAUSE