I'm trying to detect a string with 2 carriage return in a file using windows batch.
I know the file, and I need to know if the string I search is in it or not.
Here is the string :
[Terminal]
Fenetre=O
Debug=O
And here is the code I tried to use, but it doesn't work...
@echo off
findstr /M "[Terminal]\\r\\nFenetre=O\\r\\nDebug=O" C:\ETMI\ECSPyx\pyxvital\Pyxvital.ini
if %errorlevel%==0 (
echo Found! logged files into results.txt
) else (
echo No matches found
)
The final result I need, is just to know if the file contains or not this "string", if not, I will write it on the file. Else, I will put a semicolon in front of 'Fenetre'
But first, how do I find this ?
Thank you !!