MasonMill Posted September 11, 2010 Share Posted September 11, 2010 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! Link to comment Share on other sites More sharing options...
Synct Posted September 11, 2010 Share Posted September 11, 2010 (edited) $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 Filesas the directory by default, My operating system is on drive Y so mine shows Y:/Program FilesThis information is stored in the registry to tell MSI where to set the default path for newly installed programs.Furthermore,Sleep(3000)$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.1You 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 September 11, 2010 by Synct Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now