Different languages have different ways of getting information about the
visitors. However, most languages can get the User Agent, which
provides us, the webmasters, with information about the visitor’s
browser, plugins and operating system.
For example if the user agent of a visitor is:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
Windows NT 5.1 tells us what operating system the visitor is running. In this case, it’s Windows XP.
The following tells us that the user is running Windows Server 2003.
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)
But how do we find out if he is running Vista? Well, we look for Windows NT 6.0:
Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0; .NET CLR 2.0.50215)
Sometimes even if the user runs Windows Vista Beta 1 on a desktop PC, the user agent might look like this:
Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0; .NET CLR 2.0.50215; SL Commerce Client v1.0; Tablet PC 2.0)
And the following user agent string tells us the user has Avalon and Indigo installed:
Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0; .NET CLR 2.0.50215; SL Commerce Client v1.0; Tablet PC 2.0; Avalon 6.0.4030; WinFX RunTime 1.0.50215)
Here is a list of the most common releases and their actual OS version:
Windows 95 – Windows 95
Windows 98 – Windows 98
Windows NT 5.0 – Windows 2000
Windows NT 5.1 – Windows XP
Windows NT 5.2 – Windows Server 2003
Windows NT 6.0 – Windows Vista
Note that in rare cases some browsers can indicate the operating system differently. Also note that the user agent can be spoofed (changed by the visitor) to give you a false impression over the operating system or browser he is using.