|I have about 1,600 text files that have protocol analyzer information in them. I'm |
looking for specific keyword(s) within the text files, using FINDSTR. It's all good;
I get the expected results. However, when I run the batch file, the Windows
process CSRSS.exe immediately starts using more CPU than when the batch
isn't run. If I cancel the batch, CSRSS.exe settles back down immediately.
IF NOT EXIST "REQ_Types.txt" TYPE NUL>"REQ_Types.txt"
FOR %%A IN (*-*-1*.txt) DO (
FOR /F "tokens=* delims=" %%B IN (%%A) DO (
FOR /F "tokens=* delims=" %%C IN ('ECHO %%B^|FINDSTR /C:"RequestType:"') DO (
CALL :FindIt !filename! !string!
SET args=!args:%1 =!
FIND "!args!" < "REQ_Types.txt" > NUL
IF /I !ERRORLEVEL! EQU 1 (
ECHO !args! >> "REQ_Types.txt"
ECHO Filename = "%1"
ECHO Writing to file.
The source text files (zipped): http://www.mediafire.com/?636hz9tb0...
Is there something in my batch file that seems out of the ordinary, and would cause
CSRSS.exe to ramp up it's duties?!
I've confirmed that CSRSS.exe is running from the correct location and is not a virus
by using another batch file that uses WMIC.exe and TASKLIST to get process
MODE CON: COLS=132 LINES=9999
FOR /F "tokens=1* delims==" %%u IN ('WMIC Process GET Name^, CommandLine^, ProcessId^, ParentProcessId /FORMAT:LIST') DO (
IF /I "%%u" EQU "CommandLine" (
CALL :Set_CL CommandLine? %%v
IF /I "%%u" EQU "Name" (
CALL :Set_NM Name "%%v"
IF /I "%%u" EQU "ParentProcessId" (
CALL :Set_PP ParentProcessId %%v
FOR /F "tokens=1* delims=:" %%w IN ('TASKLIST /V /FO LIST /FI "PID eq !ParentProcessId!"') DO (
IF "%%w" EQU "Image Name" (
CALL :Set_NM ParentName %%x
IF /I "%%u" EQU "ProcessId" (
CALL :Set_PI ProcessId %%v
ECHO !ProcessId! - !Name! : !CommandLine?!
ECHO !ParentProcessId! - !ParentName!
SET %1= %2
SET %1= %2
When your only tool is a hammer, every problem looks like a nail.