Possible Duplicate:
A vbscript to find windows version name and the service pack
My question says it all.
Thanks.
To find out which version of Windows your device is running, press the Windows logo key + R, type winver in the Open box, and then select OK.
Open Task Manager and go to Details tab. If a VBScript or JScript is running, the process wscript.exe or cscript.exe would appear in the list. Right-click on the column header and enable "Command Line". This should tell you which script file is being executed.
Here is another version:
Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set oss = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
For Each os in oss
Wscript.Echo "Boot Device: " & os.BootDevice
Wscript.Echo "Build Number: " & os.BuildNumber
Wscript.Echo "Build Type: " & os.BuildType
Wscript.Echo "Caption: " & os.Caption
Wscript.Echo "Code Set: " & os.CodeSet
Wscript.Echo "Country Code: " & os.CountryCode
Wscript.Echo "Debug: " & os.Debug
Wscript.Echo "Encryption Level: " & os.EncryptionLevel
dtmConvertedDate.Value = os.InstallDate
dtmInstallDate = dtmConvertedDate.GetVarDate
Wscript.Echo "Install Date: " & dtmInstallDate
Wscript.Echo "Licensed Users: " & os.NumberOfLicensedUsers
Wscript.Echo "Organization: " & os.Organization
Wscript.Echo "OS Language: " & os.OSLanguage
Wscript.Echo "OS Product Suite: " & os.OSProductSuite
Wscript.Echo "OS Type: " & os.OSType
Wscript.Echo "Primary: " & os.Primary
Wscript.Echo "Registered User: " & os.RegisteredUser
Wscript.Echo "Serial Number: " & os.SerialNumber
Wscript.Echo "Version: " & os.Version
Next
Results on:
Microsoft Windows XP Professional
Version: 5.1.2600
From here:
' Copyright (c) 1997-1999 Microsoft Corporation
'************************************************************************** *
'
' WMI Sample Script - Information about the OS (VBScript)
'
' This script demonstrates how to retrieve the info about the OS on the local machine from instances of
' Win32_OperatingSystem.
'
'************************************************************************** *
Set SystemSet = GetObject("winmgmts:").InstancesOf ("Win32_OperatingSystem")
for each System in SystemSet
WScript.Echo System.Caption
WScript.Echo System.Manufacturer
WScript.Echo System.BuildType
WScript.Echo " Version: " + System.Version
WScript.Echo " Locale: " + System.Locale
WScript.Echo " Windows Directory: " + System.WindowsDirectory
WScript.Echo " Total memory: " + System.TotalVisibleMemorySize + " bytes"
WScript.Echo " Serial Number: " + System.SerialNumber
Wscript.Echo ""
next
The first message box gives me "Microsoft Windows 7 Professional".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With