I start a command window with a similar command:
start "DUMMYCOMMANDWINDOW"
I can then close the window using this command:
taskkill /FI "WINDOWTITLE EQ DUMMY*" /f /t
What I'd like to do, however, is to close the window based on its partial title. Something like this:
taskkill /FI "WINDOWTITLE EQ *COMMANDWINDOW" /f /t
Is there a way to do that?
Best Answer
Using PowerShell, you can do the following:
Get-Process
returns a list of all processes, theWhere-Object
clause filters it based on the window title, andStop-Process
is similar to taskkill.