Question

I've tried almost everything but I can't get the findstr command to work. The code below keeps giving me mbam scannen.

@Echo OFF

Set "log_file=T:\Scholen\RC01\Hitman\Hitman_RC01TS001-201304061026.txt"

findstr /C:"Malware _" T:\Scholen\RC01\Hitman\Hitman_RC01TS001-201304061026.txt

If errorlevel 1 (
    Echo Mbam scannen
    Pause
) else (
    Echo Mbam stoppen
    Pause
)

Can someone please guide me to a solution?

Was it helpful?

Solution

Might be a problem with the encoding of the file. Open the text file in Notepad, click File → Save As..., and check the Encoding field at the bottom center of the Save As dialog. If the field doesn't say ANSI, then the file is Unicode-encoded, which prevents findstr from finding a match.

Try using find instead, as suggested here:

find /c "Malware _" T:\Scholen\RC01\Hitman\Hitman_RC01TS001-201304061026.txt >nul
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top