Hi folks...OK so i have ALMOST finished my first ever batch script.
My only remaining problem is that of windowtitle filter inside the tasklist function.
I am trying to select windows with "Kingdoms of Camelot on Facebook - Cometbird". However, the VERY annoying this about facebook is, every time you get a notification, it adds it to the title bar, making it "(1) Kingdoms of cam..."
Because of this, the WINDOWTITLE filter doesn't work for me, because it now contains (1) in the title.
Is there a way to make the wildcards * or ? work inside the filter???????
All i want is for it to accept (1) or (2) etc, at the start of the titlebar, and not return an errorlevel because of them...
Here is the relevant code section....
tasklist /FI "WINDOWTITLE eq Kingdoms of Camelot on Facebook - Cometbird"2>NUL | find /I /N "cometbird.exe"2>NUL
if "%ERRORLEVEL%"=="0" goto runningcomet
if "%ERRORLEVEL%"=="1" goto notrunningcomet
So if i get a notification in facebook, it no longer works because the title now is (1) Kingdoms of cam...etc.
tasklist /FI "WINDOWTITLE eq (1) Kingdoms of Camelot on Facebook - Cometbird"2>NUL | find /I /N "cometbird.exe"2>NUL
if "%ERRORLEVEL%"=="0" goto runningcomet
if "%ERRORLEVEL%"=="1" goto notrunningcomet
Would work fine, but i need to use some sort of wildcard. Is this possible in batch files? I am very novice so please be gentle.