Zum Hauptinhalt gehen

Suche

Suche

Determine Os In Vbscript?

Kommentare

1 Kommentar

  • Avatar
    Ian Cummings
    Moderator

    A quick Google search on getting the Windows version number in VBS gave me the below example code:

     

    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
       value =  "Version: " & os.Version
    Next
    

    It seems to do the trick.  The below link gives the full name to what each version of Windows is:

     

    http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.