Advertisement
Guest User

OperatingSystemInformation.vbs

a guest
Sep 11th, 2015
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. ' Special BGInfo Script
  2. ' Operating System Information v1.3
  3. ' Programmed by WindowsStar - Copyright (c) 2009-2010
  4. ' --------------------------------------------------------
  5.  
  6. strComputer = "."
  7. Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
  8.  
  9. Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
  10.  
  11. For Each objOperatingSystem in colOperatingSystems
  12. OSCaption = Trim(Replace(objOperatingSystem.Caption,"Microsoft ",""))
  13. OSCaption = Replace(OSCaption,"Microsoft","")
  14. OSCaption = Replace(OSCaption,"(R)","")
  15. OSCaption = Trim(Replace(OSCaption,",",""))
  16. Echo OSCaption
  17. Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement