I have a small issue I am trying to determine what version of FIrefox is loaded on a computer and pull the uninstall path. The problem lies in that the enumkey is stopping at 50 entries? Is this a limitation of the function am I doing something wrong. I used a select case due to the reg entry is different for every version. Any input would be appreciated.
StrComputer = "."
On Error Resume Next Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\default:StdRegProv") unKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall\"
' Enumerate Registry subkey paths for uninstall. Note arrSubKeys objReg.EnumKey HKLM, unKeyPath, arrSubKeys For Each Subkey In arrSubKeys subkey1 = subkey(Right(15)) Select Case subkey1 Case "Mozilla Firefox" WScript.echo unKeyPath & "\"& subkey End Select Next wscript.Quit
I found a probblem if the string does not have the amount of characteters it will error out. Thank you for the pointer. Now I just have to figure out how to select that one random key
'On Error Resume Next Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\default:StdRegProv") unKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall\"
' Enumerate Registry subkey paths for uninstall. Note arrSubKeys objReg.EnumKey HKLM, unKeyPath, arrSubKeys For Each Subkey In arrSubKeys subkey1 =(left(subkey,3)) Select Case Subkey1 Case "Moz" WScript.echo unKeyPath & "\"& subkey & (Enter) End Select Next wscript.Quit