compact21 Posted August 29, 2014 Share Posted August 29, 2014 Hello, when i try to read or to write a value in the registry nothing happens, no value appears... i tryed this: RegWrite("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "TestKey", "REG_SZ", "Hello this is a test") and this: RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "TestKey", "REG_SZ", "Hello this is a test") but none of them works...the return value is 1. Note: The example script works just like it should, but when i try to read or write a value to Run, it wont work. Any ideea why? Thanks! Link to comment Share on other sites More sharing options...
Developers Jos Posted August 29, 2014 Developers Share Posted August 29, 2014 What is the returncode from RegWrite and the @error value? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
JohnOne Posted August 29, 2014 Share Posted August 29, 2014 try #requireadmin in script. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
compact21 Posted August 29, 2014 Author Share Posted August 29, 2014 What is the returncode from RegWrite and the @error value? Jos the return code is 0 and the @error value is 1 try #requireadmin in script. that doesn't work Link to comment Share on other sites More sharing options...
Developers Jos Posted August 29, 2014 Developers Share Posted August 29, 2014 This works fine for me: #RequireAdmin $rc = RegWrite("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "TestKey", "REG_SZ", "Hello this is a test") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $rc = ' & $rc & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
compact21 Posted August 29, 2014 Author Share Posted August 29, 2014 This works fine for me: #RequireAdmin $rc = RegWrite("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "TestKey", "REG_SZ", "Hello this is a test") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $rc = ' & $rc & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console Jos Thanks alot, that works for me too...any ideea what's the problem with my pice of code? Link to comment Share on other sites More sharing options...
Developers Jos Posted August 29, 2014 Developers Share Posted August 29, 2014 Thanks alot, that works for me too...any ideea what's the problem with my pice of code? It is your code with the suggested #RequireAdmin.... that's all SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now