Jump to content
Sign in to follow this  
TPlanet

RegEnumKey limitations?

Recommended Posts

TPlanet

Hi all,

I need to log all keys in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall but don't get keys with {}

CODE

CONST $file = FileOpen("c:\installed.txt",1)

For $i= 1 to 100

$var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", $i)

If @error <> 0 then ExitLoop

FileWriteLine($file,$var)

Next

FileClose $file

If I do RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9015040C-6000-11D3-8CFE-0150048383C9}","displayname") , I get the value...

Any idea?

TP

Share this post


Link to post
Share on other sites
Monamo

Hi all,

I need to log all keys in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall but don't get keys with {}

CODE

CONST $file = FileOpen("c:\installed.txt",1)

For $i= 1 to 100

$var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", $i)

If @error <> 0 then ExitLoop

FileWriteLine($file,$var)

Next

FileClose $file

If I do RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9015040C-6000-11D3-8CFE-0150048383C9}","displayname") , I get the value...

Any idea?

TP

Looks like the issue is that the "{" entries are indexed after the normal alphabetical listing when using RegEnumKey(). Additionally, you're setting a fixed number of entries to index. My guess is that you've got well over 100 entries if you're not seeing any "{" items.

Give this a shot, it'll grab all of the entries:

Const $file = FileOpen("c:\installed.txt", 1)
$sRegRoot = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
$i = 1

Do
    $var = RegEnumKey($sRegRoot, $i)
    If @error <> 0 Then ExitLoop
    FileWriteLine($file, $var)
    $i +=1
Until @error

FileClose($file)

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Share this post


Link to post
Share on other sites
TPlanet

Monamo... You're right, they were after the 150 others!

Many Thank's

TP

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.