Sign in to follow this  
Followers 0
Tr33x0rs

RegRead returning blank value

3 posts in this topic

#1 ·  Posted

I'm new to AutoIT and haven't actively programmed in 10+ years so I apologize in advance if I'm overlooking something stupid. I have a small script that I'm wanting to grab the value of a registry entry. The example I saw online works perfectly, which is: 

#include <MsgBoxConstants.au3>

Local $sVar = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir")
MsgBox($MB_SYSTEMMODAL, "Program files are in:", $sVar)
 

So I tried to modify the script to suite my needs, which looks like: 

#include <MsgBoxConstants.au3>

Local $sVar = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Adacel Technologies inc.\PCIG\Channels Geometry\Channel 1", "Aspect Distortion")
MsgBox($MB_SYSTEMMODAL, "Program files are in:", $sVar)
 

I have a value in the registry for "Aspect Distortion" of 1.0, but my MsgBox is just showing a blank box. I have provided screenshots of my registry as well as the MsgBox I am seeing. Any help is greatly appreciated!

 

IGConfigLocator.png

Share this post


Link to post
Share on other sites



#2 ·  Posted

@Tr33x0rs I am guessing you are on a 64bit machine. Realize there is a difference between the HKLM hive and the 64-bit HKLM64 hives as explained in the RegRead topic in the help file. This works just fine for me on a 64bit machine with the path you've shown:

#include <MsgBoxConstants.au3>

Local $sVar = RegRead("HKLM64\SOFTWARE\Adacel Technologies inc.\PCIG\Channels Geometry\Channel 1", "Aspect Distortion")
MsgBox($MB_SYSTEMMODAL, "Program files are in:", $sVar)

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted

You are 100% correct, that was my issue. Thank you very much for the help, I really appreciate it!

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