Returns the name and version number of the operating system installed on a computer.
strComputer = "."Set objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set colOperatingSystems = objWMIService.ExecQuery _("Select * from Win32_OperatingSystem")For Each objOperatingSystem in colOperatingSystemsWscript.Echo objOperatingSystem.Caption & " " & _objOperatingSystem.VersionNext
This is a VB Script, this can be used by saving the file in .vbs file