Jump to content

regwrite error


Recommended Posts

HI,

Is there any way to add the continuation syntax to this line of code....

I do not want to use the .reg file and want to use this registry entry in my auto it script.

Cheers,

RnJ

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Data","Toolbars","REG_BINARY","480000000d010000280000000201ffff090000000000000000001400000101010100001700920131001e006f0064016

f000100010100001700920131001e006f0064016f000100010100001700920131001e006f0064016f0001000101000017009

20131001e006f0064016f000100010100001700920131001e006f0064016f0000000000000004300201ffff0a00000000000

00000001400000101010192011700000431001e006f0064016f000100010192011700000431001e006f0064016f000100010

192011700000431001e006f0064016f000100010192011700000431001e006f0064016f000100010192011700000431001e0

06f0064016f0001000000000004300201ffffee010000000000000000100000040001fe00000000000000001e006f007b016

f00040001fe00000000000000001e006f007b016f00040001fe00000000000000001e006f007b016f00040001fe000000000

00000001e006f007b016f00040001fe00000000000000001e006f007b016f0002000000010004300201ffff0c00000000000

0000000100000010201fe00000000000000001e006f0067006f00010201fe00000000000000001e006f0067006f00010201f

e00000000000000001e006f0067006f00010201fe00000000000000001e006f0067006f00010201fe00000000000000001e0

06f0067006f0003000000010004300201ffff0d000000000000000000100000030203fe00000000000000001e008002eb028

002030203fe00000000000000001e008002eb028002030203fe00000000000000001e008002eb028002030203fe000000000

00000001e008002eb028002030203fe00000000000000001e008002eb02800204000000010004300201ffff0f00000000000

0000000100000040001fe00000000000000001e006f0064016f00040001fe00000000000000001e006f0064016f00040001f

e00000000000000001e006f0064016f00040001fe00000000000000001e006f0064016f00040001fe00000000000000001e0

06f0064016f0005000000010004300201ffff0e000000080100000000100000040001fe00000000000000009c028002e2038

002040001fe00000000000000009c028002e2038002040101fe00000000000000009c028002e2038002040101fe000000000

00000009c028002e2038002040101fe00000000000000009c028002e203800206000000010004300201ffff1000000000000

0000000100000040201fe00000000000000001e006f0064016f00040201fe00000000000000001e006f0064016f00040201f

e00000000000000001e006f0064016f00040201fe00000000000000001e006f0064016f00040201fe00000000000000001e0

06f0064016f0007000000010004300201ffff64000000000000000000100000040001fe00000000000000001e006f0064016

f00040001fe00000000000000001e006f0064016f00040001fe00000000000000001e006f0064016f00040001fe000000000

00000001e006f0064016f00040001fe00000000000000001e006f0064016f0008000000010004300201ffff6500000000000

0000000100000040201fe00000000000000001e00a1006401a100040201fe00000000000000001e00a1006401a100040201f

e00000000000000001e00a1006401a100040201fe00000000000000001e00a1006401a100040201fe00000000000000001e0

0a1006401a10009000000010004300201ffff13000000000000000000100000010201fe00000000000000001e006f0064016

f00010201fe00000000000000001e006f0064016f00010201fe00000000000000001e006f0064016f00010201fe000000000

00000001e006f0064016f00010201fe00000000000000001e006f0064016f000a000000010004300201ffff1600000000000

0000000100000010001fe00000000000000001e006f0064016f00010001fe00000000000000001e006f0064016f00010001f

e00000000000000001e006f0064016f00010001fe00000000000000001e006f0064016f00010001fe00000000000000001e0

06f0064016f000b000000010004300201ffff15000000000100000000100000040001fe00000000000000001e006f0064016

f00040001fe00000000000000001e006f0064016f00040001fe00000000000000001e006f0064016f00040001fe000000000

00000001e006f0064016f00040001fe00000000000000001e006f0064016f000c000000010004300201ffff1f00000008010

0000000100000040201fe000000000000000099007b0166037b01040201fe000000000000000099007b0166037b01040201f

e000000000000000099007b0166037b01040201fe000000000000000099007b0166037b01040201fe0000000000000000990

07b0166037b010d000000010004300201ffff17000000000000000000100000010201fe00000000000000001e006f0064016

f00010201fe00000000000000001e006f0064016f00010201fe00000000000000001e006f0064016f00010201fe000000000

00000001e006f0064016f00010201fe00000000000000001e006f0064016f000e000000010004300201ffff1800000000000

0000000100000010201fe00000000000000001e006f0064016f00010101fe00000000000000001e006f0064016f00010201f

e00000000000000001e006f0064016f00010101fe00000000000000001e006f0064016f00010201fe00000000000000001e0

06f0064016f000f000000010004300201ffff1a000000000000000000100000010001fe00000000000000001e006f0064016

f00010001fe00000000000000001e006f0064016f00010001fe00000000000000001e006f0064016f00010001fe000000000

00000001e006f0064016f00010001fe00000000000000001e006f0064016f0010000000010004300201ffff2300000000000

00000001000000102010100000000000000001e006f0064016f000102010100000000000000001e006f0064016f000102010

100000000000000001e006f0064016f000102010100000000000000001e006f0064016f000102010100000000000000001e0

06f0064016f0014000000010004300201ffff240000000000000000001000000102010100000000000000001e006f0064016

f000102010100000000000000001e006f0064016f000102010100000000000000001e006f0064016f0001020101000000000

00000001e006f0064016f000102010100000000000000001e006f0064016f0015000000010004300201ffff1802000000010

0000000100000010001fe00000000000000001e006f0064016f00010001fe00000000000000001e006f0064016f00010001f

e00000000000000001e006f0064016f00010001fe00000000000000001e006f0064016f00010001fe00000000000000001e0

06f0064016f0016000000010004300201ffff84000000000000000000100000010001fe00000000000000001e006f0064016

f00010001fe00000000000000001e006f0064016f00010001fe00000000000000001e006f0064016f00010001fe000000000

00000001e006f0064016f00010001fe00000000000000001e006f0064016f001a000000010004300201ffffbd00000000000

0000000100000010201fe00000000000000001e006f0064016f00010201fe00000000000000001e006f0064016f00010201f

e00000000000000001e006f0064016f00010201fe00000000000000001e006f0064016f00010101fe00000000000000001e0

06f0064016f001b000000010004300201ffff8b000000000000000000100000040203fe00000000000000008200760269027

602040203fe00000000000000008200760269027602040203fe00000000000000008200760269027602040203fe000000000

00000008200760269027602040203fe000000000000000082007602690276021c000000010004300201ffffa900000000010

0000000100000040003fe000000000000000072017602b8027602040003fe000000000000000072017602b8027602040003f

e000000000000000072017602b8027602040003fe000000000000000072017602b8027602040003fe0000000000000000720

17602b80276021d000000010004300201ffffa7000000000100000000100000040003fe000000000000000072013a02b8023

a02040003fe000000000000000072013a02b8023a02040003fe000000000000000072013a02b8023a02040003fe000000000

000000072013a02b8023a02040003fe000000000000000072013a02b8023a021e000000010004300201ffff8c00000000000

0000000100000040203fe00000000000000009c026f00e2036f00040203fe00000000000000009c026f00e2036f00040203f

e00000000000000009c026f00e2036f00040203fe00000000000000009c026f00e2036f00040203fe00000000000000009c0

26f00e2036f001f000000010004300201ffff8e000000000000000000100000010001fe00000000000000001e006f0005026

f00010001fe00000000000000001e006f0005026f00010001fe00000000000000001e006f0005026f00010001fe000000000

00000001e006f0005026f00010001fe00000000000000001e006f0005026f0020000000010004300201ffff1902000008010

0000000100000040201fe0000000000000000e1026f00e2036f00040201fe0000000000000000e1026f00e2036f00040201f

e0000000000000000e1026f00e2036f00040201fe0000000000000000e1026f00e2036f00040201fe0000000000000000e10

26f00e2036f0021000000010004300201fffff6010000000100000000100000040201fe000000000000000082038002e2038

002040201fe000000000000000082038002e2038002040201fe000000000000000082038002e2038002040201fe000000000

000000082038002e2038002040201fe000000000000000082038002e203800222000000010004300201fffff400000000000

0000000100000040001fe00000000000000001e006f0067006f00040001fe00000000000000001e006f0067006f00040001f

e00000000000000001e006f0067006f00040001fe00000000000000001e006f0067006f00040001fe00000000000000001e0

06f0067006f0023000000010004300201ffff12020000000000000000100000040203fe00000000000000009c026f00e2036

f00040203fe00000000000000009c026f00e2036f00040203fe00000000000000009c026f00e2036f00040203fe000000000

00000009c026f00e2036f00040203fe00000000000000009c026f00e2036f0025000000010004300201ffff4d02000000000

00000001000000102010100000000000000001e006f0064016f000102010100000000000000001e006f0064016f000102010

100000000000000001e006f0064016f000102010100000000000000001e006f0064016f000102010100000000000000001e0

06f0064016f0026000000010004300201ffff4c0200000000000000001000000102010100000000000000001e006f0064016

f000102010100000000000000001e006f0064016f000102010100000000000000001e006f0064016f0001020101000000000

00000001e006f0064016f000102010100000000000000001e006f0064016f0027000000010004300201ffff0404000001010

0000000100000030003fe00000000000000001e0

06f0064016f00030003fe00000000000000001e006f0064016f00030003fe00000000000000001e006f0064016f00030003f

e

00000000000000001e006f0064016f00030003fe00000000000000001e006f0064016f002a000000010004300201ffff4104

000000000000000010000004

0001fe00000000000000001e006f0095006f00040001fe00000000000000001e006f0095006f00040001fe00000000000000

001e006f0095006f000400

01fe00000000000000001e006f0095006f00040001fe00000000000000001e006f0095006f

002b000000010004300201ffff250000000801000101001400000102010000000000000417001e006f0

064016f000102010000000000000417001e006f0064016f000100010000000000000

417001e006f0064016f000100010000000000000417001e006f0064016f000102010000

000000000417001e006f0064016f002c000000000004300201ffff9f000000090100

000000100000040201fe00000000000000001e00830064018300040201fe00000000000000001e00830064018300040201fe

00000

000000000001e00830064018300040201fe00000000000000001e00830064018300040201fe0000000000000000

1e008300640183002d000000010004300201ffff3d040000000000000000100000040003fe0000000000000000

1e006f00eb026f00040003fe00000000000000001e006f00eb026f00040003fe00000000000000001e006f00eb

026f00040003fe00000000000000001e006f00eb026f00040003fe00000000000000001e006f00eb026f002e00

0000010004300201ffff09200000090800000000100000040001fe00000000000000001e006f0064016f00040001fe000000

0000000000

1e006f0064016f00040001fe00000000000000001e006f0064016f00040001fe00000000000000001e006f0064016f000

40001fe00000000000000001e006f0064016f0028000000010004300201ffff0a2000000908000000001000000

40001fe00000000000000001e006f0064016f00040001fe00000000000000001e006f0064016f00040001fe0000000000000

0001e006f0064016f0004000

1fe00000000000000001e006f0064016f00040001fe00000000000000001e006f0064016f002900000001000430")

[font="Franklin Gothic Medium"]RnJ[/font][font="Franklin Gothic Medium"]Script: AutoIT v3.1.1.124 (beta)[/font][font="Franklin Gothic Medium"]OS: Windows XP/2000[/font]
Link to comment
Share on other sites

Sorry for confused explanation above...I need to know the switch for multiline code. Also can anyone tell how to Run a reg file.

Cheers.

RnJ

[font="Franklin Gothic Medium"]RnJ[/font][font="Franklin Gothic Medium"]Script: AutoIT v3.1.1.124 (beta)[/font][font="Franklin Gothic Medium"]OS: Windows XP/2000[/font]
Link to comment
Share on other sites

  • Moderators

Sorry for confused explanation above...I need to know the switch for multiline code. Also can anyone tell how to Run a reg file.

Cheers.

RnJ

It's an underscore and use an "&" to continue to the next part of the string, if I understand you correctly:

Example:

MsgBox(64, 'Example', _
    "E" & _
    "x" & _
    "a" & _
    "m" & _
    "p" & _
    "l" & _
    "e")

Edit:

I guess you should also know you are limited to 4096 characters per line, and even though that is more than one line of code, with the extension "& _" it still counts as one line.

Edit2:

Just what you actually want to write to the registry is 10,024 characters, I don't think that will work, you will need probably split it up into 3 or 4 different writes.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Thanks SMOKE..this is what I was after..phew..cannot find such things in help file...

Hmm..4096...Would it overwrite the reg value if I use multiple writes..

or does RegWrite have append flag...

Cheers.

[font="Franklin Gothic Medium"]RnJ[/font][font="Franklin Gothic Medium"]Script: AutoIT v3.1.1.124 (beta)[/font][font="Franklin Gothic Medium"]OS: Windows XP/2000[/font]
Link to comment
Share on other sites

  • Moderators

Thanks SMOKE..this is what I was after..phew..cannot find such things in help file...

Hmm..4096...Would it overwrite the reg value if I use multiple writes..

or does RegWrite have append flag...

Cheers.

I saved it to a txt file all on one line, You might be able to do a FileReadLine() / RegWrite $var from FileReadLine() that way because everything else was working, but I don't know what that is or does (haven't even looked) so I'm not playing with the registry to see.

Edit:

Maybe something like this?

$FilePath = @DesktopDir & '\RegHoldValue.txt'
$FRead = FileReadLine($FilePath, 1)
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Data", "Toolbars", "REG_BINARY", $FRead)
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I was looking at solution to include the whole code in my script. The easiest way would be to run the file.reg file. Probably, AUTO IT developers can include appending to registry value flag in their next version.

Thank you SMOKE.

[font="Franklin Gothic Medium"]RnJ[/font][font="Franklin Gothic Medium"]Script: AutoIT v3.1.1.124 (beta)[/font][font="Franklin Gothic Medium"]OS: Windows XP/2000[/font]
Link to comment
Share on other sites

  • Moderators

I was looking at solution to include the whole code in my script. The easiest way would be to run the file.reg file. Probably, AUTO IT developers can include appending to registry value flag in their next version.

Thank you SMOKE.

I doubt seriously that is going to happen, just use FileInstall with the script. at time to put it in the registry put it in the temp file dir / read it/ delete it / write to the registry... don't make things harder than they need to be :).

Edit:

Might try this and see if it works (Probably should do your own values like this to make sure I did't screw them up)All the codebox/code/autoit tags are screwy with quotes for some reason, showing html for them.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I was looking at solution to include the whole code in my script. The easiest way would be to run the file.reg file. Probably, AUTO IT developers can include appending to registry value flag in their next version.

Thank you SMOKE.

I have written this just for you:

#include <Constants.au3>

Func RegAppend($keyname, $valuename, $value)
    Local $type
    $read = RegRead( $keyname, $valuename )
    Select
        Case @extended = $REG_SZ
            $type = "REG_SZ"
        Case @extended = $REG_EXPAND_SZ
            $type = "REG_EXPAND_SZ"
        Case @extended = $REG_BINARY
            $type = "REG_BINARY"
        Case @extended = $REG_DWORD
            $type = "REG_DWORD"
        Case @extended = $REG_MULTI_SZ
            $type = "REG_MULTI_SZ"
    EndSelect
    RegWrite( $keyname, $valuename, $type, $read & $value)
EndFunc
Link to comment
Share on other sites

This is a good solution. SMOKE_N ..I am trying to run a .reg file from C drive.

The following script runs but does not add any values to registry..Wonder where I am wrong.

RunWait(@ComSpec & " /c " & "REGEDIT /S" & "C:\AB\Off.reg")

[font="Franklin Gothic Medium"]RnJ[/font][font="Franklin Gothic Medium"]Script: AutoIT v3.1.1.124 (beta)[/font][font="Franklin Gothic Medium"]OS: Windows XP/2000[/font]
Link to comment
Share on other sites

I have written this just for you:

#include <Constants.au3>

Func RegAppend($keyname, $valuename, $value)
    Local $type
    $read = RegRead( $keyname, $valuename )
    Select
        Case @extended = $REG_SZ
            $type = "REG_SZ"
        Case @extended = $REG_EXPAND_SZ
            $type = "REG_EXPAND_SZ"
        Case @extended = $REG_BINARY
            $type = "REG_BINARY"
        Case @extended = $REG_DWORD
            $type = "REG_DWORD"
        Case @extended = $REG_MULTI_SZ
            $type = "REG_MULTI_SZ"
    EndSelect
    RegWrite( $keyname, $valuename, $type, $read & $value)
EndFunc

Thanks mate.

[font="Franklin Gothic Medium"]RnJ[/font][font="Franklin Gothic Medium"]Script: AutoIT v3.1.1.124 (beta)[/font][font="Franklin Gothic Medium"]OS: Windows XP/2000[/font]
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...