Sign in to follow this  
Followers 0
Sobiech

RegWrite Problem

15 posts in this topic

Topic

I cant add any reg keys ;) Tried examples from Help file.

Some functions in Autoit isnt accepted by Windows Vista or what? :evil:


This world is crazy

Share this post


Link to post
Share on other sites



put this code at the top and see if it works

#RequireAdmin

you may have to be an administrator to do this.

Share this post


Link to post
Share on other sites

Doesnt work


This world is crazy

Share this post


Link to post
Share on other sites

Doesnt work

Please post your source code up.

Share this post


Link to post
Share on other sites

#RequireAdmin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Diablo II Pather By InFlames", 275, 142, 706, 632)
$Button1 = GUICtrlCreateButton("Path", 80, 8, 81, 81, $WS_GROUP)
$Group1 = GUICtrlCreateGroup("Version", 8, 8, 65, 81)
$V1 = GUICtrlCreateRadio("1.12", 16, 34, 49, 17)
$V2 = GUICtrlCreateRadio("1.13", 16, 58, 49, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button2 = GUICtrlCreateButton("Exit", 8, 96, 153, 33, $WS_GROUP)
$Button3 = GUICtrlCreateButton("Realms", 168, 8, 97, 121, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

GUICtrlSetOnEvent($Button1, "Reg")

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

Func Reg()
ConsoleWrite("Adding" & @CRLF)
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Test", "TestKey", "REG_SZ", "Hello this is a test")
ConsoleWrite("Added")
EndFunc

DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)

No Syntax Errors


This world is crazy

Share this post


Link to post
Share on other sites

Anyone tried this script on Vista HP 64?


This world is crazy

Share this post


Link to post
Share on other sites

What are the returncode and @error values of your regwrite() ?

Really i need this?


This world is crazy

Share this post


Link to post
Share on other sites

Really i need this?

Don't know what you mean and hope you do not mean it the way you make it sound, but if you want to know if a function was successful or not you better check the retunrcode and @error.

Anyways, supply the info and you might get help.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I WAS SO STUPID!

on 64 bit Windoes i need

RegWrite("HKLM64\SOFTWARE\Test", "TestKey", "REG_SZ", "Hello this is a test")

...

Ok but if someone have 32 bit system...

Hmmm maybe

If @OSArch = x64 Then
RegWrite("HKLM64\SOFTWARE\Test", "TestKey", "REG_SZ", "Hello this is a test")
Else
RegWrite("HKLM\SOFTWARE\Test", "TestKey", "REG_SZ", "Hello this is a test")
EndIf

This world is crazy

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Won't it be HKLM64 then instead of HKLM?

When running on 64-bit Windows if you want to write a key or value specific to the 64-bit environment you have to suffix the HK... with 64 i.e. HKLM64.

;)

Edit: Slightly too late...

Edited by Mat

Share this post


Link to post
Share on other sites

x86 = 64bit system

x64 = 32bit system

<confused>

Is that right?


This world is crazy

Share this post


Link to post
Share on other sites

x86 = 64bit system

x64 = 32bit system

<confused>

Is that right?

Otherway around but here is a little known trick for you. HKLM64 will work on either or at least it did, I haven't tried it recently.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

x86 = 64bit system

x64 = 32bit system

<confused>

Is that right?

no this is not correct ... look again at what you posted and what doesn't make sense.


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Ok i know everything what i need ;)

Problem Solved

Thx


This world is crazy

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