Sign in to follow this  
Followers 0
lulu

RegWrite and Binary

5 posts in this topic

I am executing the following code in a script:

If Not $printer = "" Then

$regValName = StringFormat("%s%s\\PrinterDriverData", $regKey, $ColorMFDs[$i])

MsgBox(0,'','This is $regValName: ' & $regValName)

RegWrite($regValName, "TestXrxDeviceSettings", "Reg_Binary", "00 10 20")

EndIf

The RegWrite line works just fine, excpet that 00 10 20 value appears to be written in as decimal. The value in binary, which actutally seems to be displayed as hex, ends up as 30 30 20 31 30 20 32 30. Please view the attached Word doc to see an image of the registry value. I want the 00 10 20 value to show up in the middle section, not on the far right. Any help is appreciated.

RegValue.doc

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

If the value is in the range 0-0xFFFFFFFF then it's possible to do it this way:

; Edit: Wrong. 
;~ RegWrite($regValName, "TestXrxDeviceSettings", "Reg_Binary", 0x001020)

; Should be 0x20100000 because of little endianess. Just use Binary function.

; If bigger the 0xFFFFFFFF then this one is possible:
RegWrite($regValName, "TestXrxDeviceSettings", "Reg_Binary", Binary("0x1234567821436587"))
Edited by Authenticity

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

And you don't even neen Binary() function since that's done internally.

RegWrite($regValName, "TestXrxDeviceSettings", "Reg_Binary", "0x1234567821436587")

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

The Binary() function did the trick! Thanks

Share this post


Link to post
Share on other sites

And you don't even neen Binary() function since that's done internally.

RegWrite($regValName, "TestXrxDeviceSettings", "Reg_Binary", "0x1234567821436587")

You are correct, Sir. I really only needed the "0x"

Thanks

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