This only solves half of the problem-- and not very well, either.

$proc($nopath($mircexe)) would not be a reliable way to determine how many mIRC processes are being run-- for one, it would not help if you had multiple mIRC executables with different names (what is the expected behavior there?), and also any other program with mirc.exe as the name would throw off this count. Although unlikely, it's certainly possible that a legitimate process might also have mirc.exe as the executable name, at which point your "single instance" script would refuse to start your chat client.

There are better ways to detect whether mIRC is running than using the task manager. Ideally you would do lookups on mIRC's Window class. $com() is used because it's the only usable methodology without needing access to low-level WinAPI calls.

What you're suggesting might be useful for generalized systems diagnostics, but it's a completely different suggestion from what is being asked in this thread and does not solve the problem at hand (even forgetting the problems described above). You're still not solving the more important half of this problem, which is activating the main mIRC process when the 2nd instance is launched (like Skype does). If you want the above feature, please suggest it separately so as not to hijack this request.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"