Jump to content
m0b

Can't get RegWrite to work

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

 

Share this post


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

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

×
×
  • Create New...