Jump to content

RegWrite problem Windows 7 x64


Recommended Posts

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

  • Developers

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

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

  • Developers

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

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...