Sign in to follow this  
Followers 0

Cannot read a Registry key

3 posts in this topic

#1 ·  Posted (edited)

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

Share this post

Link to post
Share on other sites

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)


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
Live for the present,
Dream of the future,
Learn from the past.

Share this post

Link to post
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.

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  
Followers 0