Jump to content

Problem with RegWrite


Recommended Posts

Hi together,

i've got a problem with the RegWrite function. I use a *.INI for me RegKeys witch look's like:

[Tweak1]
Name=Entferne Verknüpfungspfeile
keyname="HKEY_CLASSES_ROOT\lnkfile"
valuename="IsShortcut"
type="REG_SZ"
value="-"

[Tweak2]
Name=Schnelles Herunterfahren aktivieren
keyname="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control"
valuename="WaitToKillServiceTimeout"
type="REG_SZ"
value="3000"

[Tweak3]
Name=Monitor nie aus
keyname="HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies\0"
valuename="Policies"
type="REG_BINARY"
value="01000000000000000100000000000000020000000000000000000000000000002c010000323200030400000004000000


0100000014f20600000000002c01000000000000580200000000646464649571"

[Tweak4]
Name=TestKey
keyname="HKEY_CURRENT_USER\Software\ari\test"
valuename="test1"
type="REG_SZ"
value="+"

then i let create CheckBoxes for each Tweak in a TreeView, and when i'll check the CheckBoxes and press the Install-Button, i run this little Function:

;-------------------------------------------------
;Funktion um die ausgewählten RegKeys einzutragen:
;-------------------------------------------------

Func WriteRegs()

$var = IniReadSectionNames($RegsINI)

Dim $CheckState, $i, $u, $var1, $Value, $Keytype, $valuename, $Keyname


For $i = 0 To $var[0]-1
    $CheckState = GUICtrlRead($check[$i])
    $u = $i+1
    $var1 = IniReadSection($RegsINI, "Tweak" & $u)
;1,257 = ausgewählt
;4,0,260 = nicht ausgewählt
    If $CheckState = 1 Or $CheckState = 257 Then
        $Keyname = $var1[2][1] 
        $valuename = $var1[3][1]
        $Keytype = $var1[4][1]
        $Value = $var1[5][1]
        MsgBox(64,"Info",$var1[2][1] &", "& $var1[3][1] &", "& $var1[4][1] &", "& $var1[5][1])
        RegWrite($Keyname, $valuename, $Keytype, $Value)
        GUICtrlSetState($check[$i],$GUI_UNCHECKED)
        Sleep(5)
    ElseIf $CheckState = 4 Or $CheckState = 260 Or $CheckState = 0 Then
        Sleep(1)
    EndIf
    If @error = -1 Then ExitLoop
Next

EndFunc

The MsgBox displays me the correct Values,

but RegWrite doesn't do anything. What am i doing wrong? :(:(

Thank's for your help.

pastl

p.s. sorry for my english.

Link to comment
Share on other sites

Hi together,

i've got a problem with the RegWrite function. I use a *.INI for me RegKeys witch look's like:

...

p.s. sorry for my english.

<{POST_SNAPBACK}>

Remove the double quotes from each line in the INI-file and all it works fine..

Example:

[Tweak4]
Name=TestKey
keyname=HKEY_CURRENT_USER\Software\ari\test
valuename=test1
type=REG_SZ
value=+

Regards,

-Sven

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