Jump to content

Cannot read a Registry key

Recommended Posts

Hello, I'm back since quite a long time...

I'm trying to use the RegRead to read a registry key.

The proposed example is working:

Local $var = RegRead("HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersion", "ProgramFilesDir")
MsgBox(4096, "Program files are in:", $var)

But I'm trying to read other keys and @error returns 1 (unable to open requested key).

I'm running as admin (with #RequireAdmin at the beginning of the script).



Local $path = RegRead ( "HKEY_LOCAL_MACHINESOFTWAREAVAST SoftwareAvast", "ProgramFolder")

MsgBox(4096, "The avast! path is:", $path)


Local $var = RegRead("HKEY_LOCAL_MACHINESOFTWAREGRETECHGomPlayer", "ProgramFolder")
MsgBox(4096, "The GOM path is:", $var)


What am I doing wrong?

How to achieve reading that keys?

I'm on Windows 8.1 x64.


Edited by Technical
Link to comment
Share on other sites

  • Developers

Try reading the x64 hive as you probably are running the x86 version of AutoIt3:

Local $path = RegRead ( "HKEY_LOCAL_MACHINE64\SOFTWARE\AVAST Software\Avast", "ProgramFolder")
MsgBox(4096, "The avast! path is:", $path)


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
Live for the present,
Dream of the future,
Learn from the past.

Link to comment
Share on other sites

It does not seem to be this. I'm running:

AutoIt3_x64.exe "my_script" with Local $path = RegRead ( "HKEY_LOCAL_MACHINE64SOFTWAREAVAST SoftwareAvast", "ProgramFolder")


AutoIt3.exe,exe "my_script" with Local $path = RegRead ( "HKEY_LOCAL_MACHINESOFTWAREAVAST SoftwareAvast", "ProgramFolder")

and I'm getting the same results.

I also compiled the script for x64 and x32 (with proper hives on them) and got nothing.

I'll also have to discover how to detect x32 or x64 to automate...

Thanks for your help.

Link to comment
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...