PDA

View Full Version : Searching Registry for keys?



Alex_W
06-04-2007, 04:04 PM
Hi

Project Type: InstallScript MSI

I’m looking for a suggestion on how I would do this. Under myApp registry key there is a Connections key with subkeys that are user defined. So under Connections there could be MyOffice, YourOffice, SomePlace, each with connection string. I know where the “Connections” key is but I want the connection data from each of the user created subkeys. Its seems that all of the build in registry command (unless I’m reading it wrong or missed something which is very likely) require a key name and return a value. But how do I search for all keys under a specified key?

Thanks for any suggestions.

bdshan
06-04-2007, 04:20 PM
Look in the help for registry functions. There is one the will enumerate all sub keys and/or values of a given key. I don't have access to the installscript reference right now or I'd give you the function name.

The function returns a LIST, so you would need to iterate thru the LIST to get the data stored in each key.


Found it...


The RegDBQueryKey function allows users to query a key for its subkeys and value names. The keys can be enumerated dynamically at run time using this function. RegDBQueryKey is a general registry-related function, designed to work with all registry keys, including those handled by the special registry-related functions.

Alex_W
06-04-2007, 04:44 PM
Thanks! RegDBQueryKey() is just want Im looking for.