Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A vbscript to find windows version name and the service pack

Tags:

vbscript

What's the simplest way to find out which version of Windows, and which service pack, is running on a computer with VBScript?

For example I'd want to know Windows XP and Service Pack 3.

like image 324
Evan Avatar asked Nov 30 '10 19:11

Evan


1 Answers

An easy way of doing this is to use the WMI class Win32_OperatingSystem which has the properties ServicePackMajorVersion, ServicePackMinorVersion, Name and Version. You can find samples here: WMI Tasks: Operating Systems

The data you get back might not be in the exact format that you want though so you might need to have some kind of lookup table to make it look exactly right.

like image 107
Hans Olsson Avatar answered Nov 19 '22 07:11

Hans Olsson