Jump to content

Can't get RegWrite to work


m0b
 Share

Recommended Posts

Hi!  I'm a noobie to Autoit, i have the world's simplest script as follows.

 

Quote

   #RequireAdmin

   $result = RegWrite("HKLM64\Software\AutoIt_Example", "Key1", "REG_SZ", "This is an example of RegWrite")

   msgbox ("","Result",$result)

 

It always returns a 1 when running. I'm on Windows 10 Pro build 1809.  I'm running the script via Windows explorer by right clicking on it and choosing Run Script (x64).  No matter what I do I can't get it to create and write the registry key.  AutoIT_Example and all subkeys do not currently exist.

I am missing something obvious I think, but no amount of google searching has helped me out here. What am I missing? Thanks in advance!

m0b

 

Link to comment
Share on other sites

  • Moderators

@m0b Result 1 for RegWrite means success. This works for me on Windows 10 Pro 1809, it creates the key and value just fine. Are you looking under HKLM\Software (which you should be) or the WOW6432Node?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Ah, thanks @JLogan3o13.  I was looking in the registry for the wrong spot, and was also a little confused as I'm used to a return of 0 meaning success with other scripting languages versus a 1 here meaning all is well. The above works fine! 

 

Thanks again.

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
 Share

  • Recently Browsing   0 members

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