Re: post #3, there are lots of different ways of doing the same thing... 
Code:
Windows XP
SELECT Version, ProductType FROM Win32_OperatingSystem WHERE Version = '5.1%' AND ProductType = '1'
SELECT Version, ProductType from Win32_OperatingSystem WHERE Version = '5.1.2600' AND ProductType = '1'
SELECT Version, ProductType from Win32_OperatingSystem WHERE Version LIKE '5.1.%' AND ProductType = '1'
Code:
Windows 7
SELECT Version, ProductType FROM Win32_OperatingSystem WHERE Version = '6.1%' AND ProductType = '1'
SELECT Version, ProductType FROM Win32_OperatingSystem WHERE Version = '6.1.7600' AND ProductType = '1'
SELECT Version, ProductType FROM Win32_OperatingSystem WHERE Version LIKE '6.1.%' AND ProductType = '1'
Code:
Windows Server 2008 R2
SELECT Version, ProductType FROM Win32_OperatingSystem WHERE Version = '6.1%' AND ProductType <> '1'
SELECT Version, ProductType FROM Win32_OperatingSystem WHERE Version = '6.1.7600' AND ( ProductType = '2' OR ProductType = '3' )
SELECT Version, ProductType FROM Win32_OperatingSystem WHERE Version LIKE '6.1.%' AND ProductType <> '1'
Some other filters you may find useful...
Code:
32-bit OS
SELECT OSArchitecture FROM Win32_OperatingSystem WHERE OSArchitecture='32-bit'
Code:
64-bit OS
SELECT OSArchitecture FROM Win32_OperatingSystem WHERE OSArchitecture='64-bit'
Code:
NOT A Server OS
SELECT ProductType FROM Win32_OperatingSystem WHERE ProductType = '1'
Code:
NOT a laptop (assumes every laptop uses SO-DIMM RAM)
SELECT FormFactor FROM Win32_PhysicalMemory WHERE FormFactor != 12