Is there a way to identify a process by it's window title? Specifically, I need a batch file to close a specific Explorer window with the title Logs
I'm not sure if the tasklist command can do it. It does mention WINDOWTITLE. However, I couldn't find one good example to try when searching on google. Heck, I dont even know if it's possible with any native command.
Thanks in advance,
MKANET
Any way to identify an application by Window title?
Moderator: DosItHelp
Re: Any way to identify an application by Window title?
I think I got it! I was almost there...
tasklist /fi "WINDOWTITLE eq Logs"
tasklist /fi "WINDOWTITLE eq Logs"
Re: Any way to identify an application by Window title?
Pretty sure if you read the help from the cmd window you could see some examples.
Re: Any way to identify an application by Window title?
Hopefully, that should go without saying.
Tasklist /?, as well as, and the first couple of MS website didn't have any real-life examples I could follow. Luckily, I found a URL which used this command in a normal real-life example.

Squashman wrote:Pretty sure if you read the help from the cmd window you could see some examples.
Re: Any way to identify an application by Window title?
TASKLIST help shows exactly how to use the FILTERS. Do you expect Microsoft to put every possible filter combination into the examples when really only one is needed. It works the same for all the Filters. It would be redundant!
How do you not extrapolate from that how to use all the Filters?
Code: Select all
Filters:
Filter Name Valid Operators Valid Value(s)
----------- --------------- --------------
STATUS eq, ne RUNNING | NOT RESPONDING
IMAGENAME eq, ne Image name
PID eq, ne, gt, lt, ge, le PID value
SESSION eq, ne, gt, lt, ge, le Session number
SESSIONNAME eq, ne Session name
CPUTIME eq, ne, gt, lt, ge, le CPU time in the format
of hh:mm:ss.
hh - hours,
mm - minutes, ss - seconds
MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB
USERNAME eq, ne User name in [domain\]user
format
SERVICES eq, ne Service name
WINDOWTITLE eq, ne Window title
MODULES eq, ne DLL name
Examples:
TASKLIST
TASKLIST /M
TASKLIST /V
TASKLIST /SVC
TASKLIST /M wbem*
TASKLIST /S system /FO LIST
TASKLIST /S system /U domain\username /FO CSV /NH
TASKLIST /S system /U username /P password /FO TABLE /NH
TASKLIST /FI "USERNAME ne NT AUTHORITY\SYSTEM" /FI "STATUS eq running"
How do you not extrapolate from that how to use all the Filters?