Jump to content
Sign in to follow this  
gcue

regwrite a registry dword value

Recommended Posts

gcue

i am looking at a remote pc registry entry

$reg = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\Office12-HP4350DTN\PrinterDriverData", "Forms?")

it returns a value of "2173314341"

when i write that value

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\Office14-HP4350DTN\PrinterDriverData", "Forms?", "REG_DWORD", $reg)

the value changes to "2147483648"

any ideas?

Edited by gcue

Share this post


Link to post
Share on other sites
LarryDalooza

Is it a DWORD? Because the max value of a DWORD is 2147483647. Check the value again... is it a DWORD?

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites
gcue

it is a DWORD.. so if that's the max value for a dword, how would i be able to write values that exceed that?

Share this post


Link to post
Share on other sites
LarryDalooza

I am sorry... I am incorrect. ... just use Number($reg)

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\Office14-HP4350DTN\PrinterDriverData", "Forms?", "REG_DWORD", Number($reg))

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites
PsaltyDS

It's an unsigned 32-bit value, so the max value is 2^32 - 1 = 4294967295 (4Gig) = 0xFFFFFFFF:

$reg = 4294967295
RegWrite("HKCU\SOFTWARE\AutoIt v3", "TestData", "REG_DWORD", $reg)

:blink:

Edit: Larry already saved it! ;)

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
gcue

actually that didnt work.

number($reg) shows the right value but when i regwrite that.. it doesnt work... did it work for you?

Share this post


Link to post
Share on other sites
gcue

i am able to get the HEX value doing this:

Hex(int($reg))

but when i try to regwrite that as a value, it writes it as a string so its still wrong =/

Share this post


Link to post
Share on other sites
gcue

ok this worked:

RegWrite value "0x" & Hex(int($reg))

thanks again for your help fellas =)

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.