Sign in to follow this  
Followers 0
aiuse

Can't add registry key

11 posts in this topic

#1 ·  Posted (edited)

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, aiuse. Is it being created in HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersion?


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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

#4 ·  Posted (edited)

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
1 person likes this

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Actually in this case, I believe it would be #AutoIt3Wrapper_UseX64=y if he would like it not to go into the x86 area.


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

Share this post


Link to post
Share on other sites

I tried both but still no go. Please help. Thanks

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

Glad you got it working. Odd that it worked for me without the HKEY_LOCAL_MACHINE64. Wonder what the difference was.


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

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