+ Post New Thread
Results 1 to 3 of 3
How do you do....it? Thread, Reading registry in AutoIT in Technical; Hi Folks, I'm using AutoIT to parse some registry information into a text file. I am only just learning C++ ...
  1. #1
    NickHoughton's Avatar
    Join Date
    May 2008
    Location
    Accrington
    Posts
    79
    Thank Post
    16
    Thanked 4 Times in 3 Posts
    Rep Power
    14

    Reading registry in AutoIT

    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\pr ogram_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")

  2. #2

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,229
    Thank Post
    1,056
    Thanked 1,066 Times in 623 Posts
    Rep Power
    739
    Try the RegRead function:

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

  3. #3
    NickHoughton's Avatar
    Join Date
    May 2008
    Location
    Accrington
    Posts
    79
    Thank Post
    16
    Thanked 4 Times in 3 Posts
    Rep Power
    14

    Hmm.

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

SHARE:
+ Post New Thread

Similar Threads

  1. Reading roaming profiles
    By stratisphere in forum Coding
    Replies: 0
    Last Post: 20th September 2008, 12:20 PM
  2. Some Light Reading
    By russdev in forum BSF
    Replies: 6
    Last Post: 15th January 2008, 12:35 AM
  3. Reading FMS from Access
    By LitVer in forum MIS Systems
    Replies: 11
    Last Post: 25th May 2007, 08:19 AM
  4. Reading an Access database with .Net 2.0
    By Jobos in forum Web Development
    Replies: 2
    Last Post: 22nd May 2007, 09:49 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •