I am trying to write a windows batch file that will print and execute a command if a window is open on the system. I can do this with a process but this is not the effect i want. I want to know if a window is open if so then print open if not do nothing, If there is a way that i can do this please let me know. Better description is when you open taskmanager and the first tab shows open windows. I just want a list of these windows and then from there just search for a program such as googlechrome.exe
Thank you all in advanced!
To see which executables are running from the command line, use:
tasklist.exe. This enables you to filter on aWINDOWTITLEattribute as well. Beyond that, you might be out of luck.Example to see if an untitled notepad instance is running:
You might use this inside a batch file as follows: