Jump to content

another issue with registry wildcard


 Share

Recommended Posts

well its me again. i think i ask more questions here that anyone. im trying to build a function to search the windows registry. i want to search the part that holds the installer information:

"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\"

there are a bunch of random subkeys. i basically need a loop to search each key as such:

"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\XXXXXXX\InstallProperties", "DisplayName

with XXXXXXX being a wildcard. this is so i can pick and choose the programs i need and report back with the info. i just have a hard time because there is no wildcard for reading the registry.

Link to comment
Share on other sites

well its me again. i think i ask more questions here that anyone. im trying to build a function to search the windows registry. i want to search the part that holds the installer information:

"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\"

there are a bunch of random subkeys. i basically need a loop to search each key as such:

"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\XXXXXXX\InstallProperties", "DisplayName

with XXXXXXX being a wildcard. this is so i can pick and choose the programs i need and report back with the info. i just have a hard time because there is no wildcard for reading the registry.

Try _RegSearch(). It won't search with a wildcard in the middle of the string path, but can list only all keys under "...\Products\" in an array. Then you just walk that array and test the InstallProperties subkeys of those.

Since the recursive logic is already solved for you, modifying the compare logic to exactly what you want wouldn't be hard either (maybe a RegExp instead of StringInStr).

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...