Sign in to follow this  
Followers 0
ALTIN

[SOLVED] How to get all values inside a registry key?

4 posts in this topic

#1 ·  Posted (edited)

Hello guys, i need a way to get all values that are under a specific registry key, for example all values under

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run.

I know I can use RegRead ( "keyname", "valuename" ) by specifying the "valuename" but i want to get all these valuenames under the specific "keyname" in this case under Run

Is there something im missing?? I can't figure out any simple way....

thanks for any help...

Edited by ALTIN

Share this post


Link to post
Share on other sites



this is not going to answser you question entirely, but i did something simalar once to find all the installed instaces of SQL like this

$instanceName = "MSSQLSERVER"
$x = 0
Do
     $x += 1
     $instances = RegEnumVal("HKLM\SOFTWARE\Microsoft SQL Server\Instance Names\SQL", $x)
Until @error <> 0 Or $instances = $instanceName

so, i know it doesn't do exactly what you need, but you can mold it into what you do need it to do. it does read all the values in a key, so you could do like

FileWriteLine($hFile, $instances)

for each $value. Good luck. hopefully it helps.

Share this post


Link to post
Share on other sites

Have a look here:

It is easy to adapt the script for your need.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hey @redLabel & @UEZ, thanks so much, with your help I got what i was missing: RegEnumVal() is what i needed and actually does the job.

Here is what I have now and that is the solution:

For $i = 1 to 100
$var = RegEnumVal("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $i)

if @error <> 0 Then ContinueLoop
MsgBox(4096, $var, RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $var))
Next

:graduated:

Edited by ALTIN

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  
Followers 0