FWIW, in 99.9% of cases, $os is cosmetic. There are pretty much no instances where you need to check $os in a script; it's only really useful in diagnosing bugs in mIRC.

If you're using some script that advertises your system details and you thing it's absolutely necessary to tell them you're running Windows 8, just add "Windows 8" to your script. Or just use a more reliable mechanism, like $COM (see moo script for details on this).

Sidenote: "7" is a heck of a lot more useful than "unknown". That at least narrows it down to "7 or greater" when someone is trying to diagnose a possible mIRC bug or script issue.

While we're on the subject of improving $os though, it's important to note that the way mIRC grabs the OS version is probably the worst way possible. mIRC *should* use a proper API call (the one that moo script does) to get the full OS version name as reported by the OS. AFAIK, mIRC's current mechanism involves MANUALLY translating the build version number into a version name, which is error prone and leads to these "future" problems. Asking Windows for its version name is much better than trying to map it yourself. There's a registry key for this. There is a whole slew of version data in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion -- mIRC should grab one of these and extract the value after "Windows" (if that even matters). Preferably it should just list the entire ProductName string verbatim, but there are probably some backwards compatibility concerns with this.


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