Jump to content
Sign in to follow this  


Recommended Posts

Hey guys,

Im trying to figure out how regread works. Ive been looking at the help file but with the example its not apparent to me. Could someone post a regread of a file that is more apparent, where it is like say some program like the calculator? Thanks!

Share this post

Link to post
Share on other sites

$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir")

MsgBox(4096, "Program files are in:", $var)

Hey Mason, The example above makes sense if you are familiar with the registry so let me break it down.

RegRead is the command, tells autoit to read the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion"

and find the value "ProgramFilesDir"

"ProgramFilesDir is then made the "$var"(variable) which is displayed in place of $var in the messagebox.

Windows sets C:/Program Files

as the directory by default, My operating system is on drive Y so mine shows Y:/Program Files

This information is stored in the registry to tell MSI where to set the default path for newly installed programs.



$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "Version")

MsgBox(4096, "Your version of AutoIt is:", $var)

RegRead looks at the key "HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt"

Which has a value of v3.3.6.1 for me (your version may be different)

And the messagebox displays : Your version of AutoIt is: v3.3.6.1

You can see all the values manually using regedit (type regedit in a run or cmd window)

WARNING I HIGHLY suggest not editing anything in the registry unless you know what you are doing, be sure to make a backup before making any changes)

I hope this makes some more sense to you, Cheers -Synct

Edited by Synct

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...