http://dieseyer.de • all rights reserved • © 2011 v11.4

'v5.A********************************************************
' File: wmi-winver.vbs
' Autor: dieseyer@gmx.de
' dieseyer.de
'
' Einige Infos zum Betreibssystem.
'
' Im wesentlichen aus
' http://www.microsoft.com/downloads/details.aspx?FamilyID=b4cb2678-dafb-4e30-b2da-b8814fe2da5a&DisplayLang=en
'************************************************************

Option Explicit ' Siehe http://dieseyer.de/dse-wsh-lernen.html#OptionExpl

Dim Txt

Dim strComputer : strComputer = "."
Dim objWMIService : Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Dim colOperatingSystems : Set colOperatingSystems = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2").ExecQuery("Select * from Win32_OperatingSystem")

Dim objOperatingSystem
For Each objOperatingSystem in colOperatingSystems
Txt = Txt & objOperatingSystem.ServicePackMajorVersion & "." & objOperatingSystem.ServicePackMinorVersion
Next
' Txt = Txt & vbCRLF
Txt = ""

Dim colOSes : Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
Dim objOS
For Each objOS in colOSes
Txt = Txt & vbCRLF & "Computer Name: " & objOS.CSName
Txt = Txt & vbCRLF & "Caption: " & objOS.Caption 'Name
Txt = Txt & vbCRLF & "Version: " & objOS.Version 'Version & build
Txt = Txt & vbCRLF & "Build Number: " & objOS.BuildNumber 'Build
Txt = Txt & vbCRLF & "Build Type: " & objOS.BuildType
Txt = Txt & vbCRLF & "OS Type: " & objOS.OSType
Txt = Txt & vbCRLF & "Other Type Description: " & objOS.OtherTypeDescription
Txt = Txt & vbCRLF & "Service Pack: " & objOS.ServicePackMajorVersion & "." & objOS.ServicePackMinorVersion
Next

MsgBox Txt, , WScript.ScriptName

http://dieseyer.de • all rights reserved • © 2011 v11.4