I'm looking for this for a few time, but I don't really know what to search for in this case.
I don't know if you know the problem with Firefox: If you start Firefox shortly after closing it, there will often be an error. Such like: Firefox is still running but doesn't react (Sorry i don't know the real english message).
Therefor I wrote a small .bat that only kills the task "firefox.exe" and then starts it again. At the moment this .bat is startet instead of the normal .exe. So that I don't have to open the taskmanager or the cmd to do it by myself. (yes I'm a bit lazy

The problem in this workaround is:
If I have an open window and I want to start a second, the .bat will be invoked. So all firefox windows will be closed before opening a new one.
Now I'm reflecting if there is any possibility, to look for the open windows. I think it would be enough to get the Windowname, because in every Firefox window at the end of the name is "Mozilla Firefox". And working with strings won't be the problem.
Is there any possibility for this? If you know a language where this will be easier, I'm open for everything :p
I know there are a few ways to get a second window, but it does no harm to get it easier and faster

Thanks in advance
Marius