1.

Solve : Batch - Count processes?

Answer»

Can someone help me with counting the number of opened processes of hlds.exe

something like

Code: [Select]TASKLIST /NH | FIND /I "hlds"
IF %ERRORLEVEL%==0 (
echo hlds Running
)
IF %ERRORLEVEL%==1 (
echo hlds not Running
)
But here it SHOWS me if i have 3 hlds.exe processes opened, show the details of each , and then "hlds Running"

but i want to count the number of them


Thx Did you read the help for the FIND command?
Quote

H:\>find /?
Searches for a TEXT string in a file or files.

FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]]

/V Displays all lines NOT containing the specified string.
/C Displays only the count of lines containing the string.
/N Displays line numbers with the displayed lines.
/I IGNORES the case of characters when searching for the string.
/OFF[LINE] Do not skip files with OFFLINE attribute set.
"string" Specifies the text string to find.
[drive:][path]filename
Specifies a file or files to search.

If a path is not specified, FIND searches the text typed at the prompt
or piped from another command.


Discussion

No Comment Found