Pages

Showing posts with label check operating system installed on a machine.. Show all posts
Showing posts with label check operating system installed on a machine.. Show all posts

Friday, 15 June 2012

Get Operating System installed on a machine


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
    Wscript.Echo objOperatingSystem.Caption & " " & _
        objOperatingSystem.Version
Next