Jump to content
Sign in to follow this  
speedy6

Register

Recommended Posts

speedy6

Hi,

Is there a way to look in the registry and do a loop (like array) to see how many key's there are within a key:

$patchmsn = REG****("HKEY_CURRENT_USER\SOFTWARE\Controller") -> Want a array list with witch key's there are in my program controller...

Thanks

Share this post


Link to post
Share on other sites
DjDeep00

Search the help file for RegEnumKey.

Share this post


Link to post
Share on other sites
speedy6

I've found this:

For $i= 1 to 10

$var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE", $i)

If @error <> 0 then ExitLoop

MsgBox(4096, "SubKey #" & $i & " under HKLM\Software: ", $var)

Next

But I don't know how many key's there are...

Share this post


Link to post
Share on other sites
DjDeep00

Make it goto any large number like 1000. Dont worry you wont get any errors because of the If @error <> 0 then ExitLoop.

Share this post


Link to post
Share on other sites
weaponx

$var = 0

While 1

RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE", $i)

If @error <> 0 then ExitLoop

$var += 1

WEnd

MsgBox(4096, $var & " total")

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.