Page 1 of 1

Why this doesnt works ? (searching for batch with title)

Posted: 06 Feb 2012 10:15
by silent
Hi,i got a code that GrellesLicht28 gave me,and he says it works for him.But for me it doesnt :(
Here it is :

Code: Select all

tasklist /NH /FI "imagename eq cmd.exe" /FI "windowtitle eq HackGameNotepad" 2>nul | findstr /i "cmd.exe" >nul 2>nul && echo Process is running. || echo Process is not running. 


its searching for a batch ile with title "HackGameNotepad" but it always shows me "Process is not running" (when i run that batch with that tile 2)

I have same OS as him (WinXP Pro SP3)

Is there any mistake ? i replaced CMD.exe to cmd.exe cos it appears like that on my task manager.Or,is there any other way to search for batch with specified title ?

Re: Why this doesnt works ? (searching for batch with title)

Posted: 06 Feb 2012 10:42
by Squashman
I would put an asterisk in your Window Title option.
/FI "windowtitle eq HackGameNotepad*"

And you need to use the /V option to display the Window Title in the output.

Re: Why this doesnt works ? (searching for batch with title)

Posted: 06 Feb 2012 11:10
by Ed Dyreen
'

Code: Select all

tasklist /nh /fi "windowTitle eq HackGameNotepad*"|findStr.EXE /blic:"cmd.exe"&&echo.yes||echo.no
It would help to run tasklist /v and copy paste the line ur after.