Posted by Remo1075 Tue 27th Feb 2007 17:51 - Syntax is Diff - 18 views
Download | New Post | Modify | Hide line numbers
  1. ' List Operating System and Service Pack Information
  2.  
  3. ' Windows Server 2003 : Yes
  4. ' Windows XP : Yes
  5. ' Windows 2000 : Yes
  6. ' Windows NT 4.0 : Yes
  7. ' Windows 98 : Yes
  8.  
  9.  
  10. strComputer = "."
  11. Set objWMIService = GetObject("winmgmts:" _
  12.  & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
  13.  
  14. Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
  15. For Each objOS in colOSes
  16.   Wscript.Echo "Computer Name: " & objOS.CSName
  17.   Wscript.Echo "Caption: " & objOS.Caption 'Name
  18.   Wscript.Echo "Version: " & objOS.Version 'Version & build
  19.   Wscript.Echo "Build Number: " & objOS.BuildNumber 'Build
  20.   Wscript.Echo "Build Type: " & objOS.BuildType
  21.   Wscript.Echo "OS Type: " & objOS.OSType
  22.   Wscript.Echo "Other Type Description: " & objOS.OtherTypeDescription
  23.   WScript.Echo "Service Pack: " & objOS.ServicePackMajorVersion & "." & _
  24.    objOS.ServicePackMinorVersion
  25. Next

PermaLink to this entry https://pastebin.co.uk/11079
Posted by Remo1075 Tue 27th Feb 2007 17:51 - Syntax is Diff - 18 views
Download | New Post | Modify | Hide line numbers

 

Comments: 0