Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBS script help

Status
Not open for further replies.

XaviPR

Technical User
Feb 7, 2014
1
US
I want to run the script below on multiple computers.


on error resume next

Const strComputer = "."
Const HKLM = &H80000002
Const strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"


Dim oReg, arrSubKeys, strProduct, strDisplayName, strVersion


Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")


' Enumerate the subkeys of the Uninstall key
oReg.EnumKey HKLM, strKeyPath, arrSubKeys
For Each strProduct In arrSubKeys
' Get the product's display name
oReg.GetStringValue HKLM, strKeyPath & "\" & strProduct, "DisplayName", strDisplayName
' Process only products whose name contain 'Microsoft'
If InStr(1, strDisplayName, "Microsoft Silverlight", vbTextCompare) > 0 Then
' Get the product's display version
oReg.GetStringValue HKLM, strKeyPath & "\" & strProduct, "DisplayVersion", strVersion
WScript.Echo strDisplayName & vbTab & strVersion
End If
Next



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top