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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
silent
Posts: 44
Joined: 28 Oct 2011 14:40

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

#1 Post by silent » 06 Feb 2012 10:15

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 ?

Squashman
Expert
Posts: 4484
Joined: 23 Dec 2011 13:59

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

#2 Post by Squashman » 06 Feb 2012 10:42

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.

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

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

#3 Post by Ed Dyreen » 06 Feb 2012 11:10

'

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.

Post Reply