Reputation: 1178
I am having trouble trying to get my VBscript to read the version number of each of the Firefox plugins. These plugins are locatated at HKEY_LOCAL_MACHINE\SOFTWARE\MozillaPlugins
. Each are in a seperate folder and each contain a key Version
with the value that I am looking for (Screenshot to make it clearer). I understand that i need to use wmi but I think ill need a loop to go through each folder. I was using this link to help me but I keep getting lost.
Any help or further information on this would be greatly appreciated. I apologize if this question is poorly asked, I have very limited VBscripting skills. If so, leave a comment and Ill try and provide more information.
Upvotes: 0
Views: 3140
Reputation: 42182
Next time please publish what you have allready got, as little as it is. Here a script i just made
on error resume next
dim aKeys, version
Const HKEY_CURRENT_USER = &H80000001, HKEY_LOCAL_MACHINE = &H80000002
set oShell = WScript.CreateObject("WScript.Shell")
set objreg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
strKeyPath = "Software\MozillaPlugins"
'read subkeys in array aKeys
objreg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, aKeys
for each subkey In aKeys
'read from version key if available
version = oShell.RegRead("HKEY_LOCAL_MACHINE\" & strKeyPath & "\" & subkey & "\version")
if version = "" then
'perhaps version info in keyname itself ?
version = split(split(subkey,"version=")(1),",")(0)
end if
if version = "" then
version = "no version info available"
end if
wscript.echo split(subkey,",")(0) & ": " & version
version = ""
next
gives on my system
@adobe.com/FlashPlayer: 10.0.45.2
@docu-track.com/PDF-XChange Viewer Plugin: 1.0
@java.com/JavaPlugin: 160_23
@Microsoft.com/NpCtrl: 4.1
@microsoft.com/WPF: 3.5
@tracker-software.com/PDF-XChange Viewer Plugin: 1.0
@View22/View22: 3.10.50
Adobe Reader: 10.1.0
Upvotes: 1