Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Enumkey Limitations?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,48416
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Enumkey Limitations?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Enumkey Limitations? - 6/18/2007 2:09:55 AM   
  gotoloop

 

Posts: 7
Score: 0
Joined: 6/18/2007
Status: offline
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
 
 
Post #: 1
 
 RE: Enumkey Limitations? - 6/18/2007 2:12:49 AM   
  ebgreen


Posts: 5250
Score: 31
Joined: 7/12/2005
Status: offline
Comment out the On Error Resume Next and see what error you get.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to gotoloop)
 
 
Post #: 2
 
 RE: Enumkey Limitations? - 6/18/2007 2:34:03 AM   
  gotoloop

 

Posts: 7
Score: 0
Joined: 6/18/2007
Status: offline
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

(in reply to gotoloop)
 
 
Post #: 3
 
 RE: Enumkey Limitations? - 6/18/2007 2:45:11 AM   
  gotoloop

 

Posts: 7
Score: 0
Joined: 6/18/2007
Status: offline
Got it... and just for refence.


Const HKLM = &H80000002 ' HKEY_LOCAL_MACHINE
Const REG_SZ = 1 ' String value in registry (Not DWORD)
Const ForReading = 1
Const ForWriting = 2

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 =(left(subkey,3))
Select Case Subkey1
Case "Moz"
WScript.echo unKeyPath & "\"& subkey & (Enter)
End Select
Next
wscript.Quit

(in reply to gotoloop)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Enumkey Limitations? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts