Jump to content

Recommended Posts

Posted

Hi Folks,

 

I'm using AutoIT to parse some registry information into a text file.

I am only just learning C++ as my 1st programming langugage - so the syntax is a little confusing to me.

Here is what I have so far but it's not giving what I need.

 

The reg key i need is \hklm\software\windows\currentversion\uninstall\program_name\DisplayName

 

Where program_name is a variable. The program works to read the "program_name" bit but does not read the subkey DisplayName.

 

Any ideas gratefully received.

 

My project is to generate list of installed programs without using any 3rd party tool. Once I have the text, I'll be able to parse into a database I hope. It's a license management exercise.

 

 

 

;Program to read Uninstall part of registry

;To show list of installed apps.

 

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

 

; Check if file opened for writing OK

If $file = -1 Then

MsgBox(0, "Error", "Unable to open file.")

Exit

EndIf

 

For $i= 1 to 999

 

 

 

$var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\UNINSTALL", $i)

$var2=RegEnumKey($var, "displayname")

 

If @error <> 0 then ExitLoop

 

 

FileWrite($file, $var2 & @CRLF)

 

Next

fileclose($file)

MsgBox(0,"Registry Reading" , "Completed. Thank You")

Posted

Try the RegRead function:

 

$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir")
MsgBox(4096, "Program files are in:", $var)

Posted
OK. I can read the different key names in the \\hklm\software\microsoft\windows\currentversion\uninstall section of the registry which is great. I don't know how to successfully pass that path to next regread command.

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



×
×
  • Create New...