Jump to content
Sign in to follow this  
aiuse

Can't add registry key

Recommended Posts

Hi,

I am trying to add a registry key with using RegWrite but it is not doing it. I also added the #RequireAdmin at the top of the script. Only if I run the reg file manually, the key is added.

Here is the key.

RegWrite("HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersion","test","REG_SZ","C:Windowstest.bmp")

 

 

Please advise.

 

Thanks

Edited by aiuse

Share this post


Link to post
Share on other sites

Hi JLogan, you are right. I just checked and found that was created under HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersion. Do you know why it is not created under HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersion? It is Win7 x64 machine but i don't think it is matter because the manual process did it.

I really need it to be added to the HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersion. Please advise. Thanks

Edited by aiuse

Share this post


Link to post
Share on other sites

I believe it has something to do with registry redirection, where the os decides where a key is meant for.

You have two options, websearch "disable redirection" to explicitly turn it off and back on after write, or it could be as simple as #Autoitwrapper usex64 = n

(or something like that)

EDIT: 

#AutoIt3Wrapper_UseX64=n
Edited by JohnOne

Share this post


Link to post
Share on other sites

Thank you SO much John. I thank to JLogan too. I got it working now by using HKEY_LOCAL_MACHINE64.

Share this post


Link to post
Share on other sites

I truly just have to change it to MACHINE64. We have Windows 7 64bit machines. I did not have any clue to fix this until you all helped me.

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  

×
×
  • Create New...