Shadowpp Posted March 13, 2010 Posted March 13, 2010 How would I change multiple specific values in the registry entry below? Specifically, only the ones in bold?[HKEY_USERS\S-1-5-21-64564757-1305693117-1901743163-33671\Printers\DevModePerUser]"\\\\ipp://10.96.14.12\\PHXBZ11"=hex:5c,00,5c,00,69,00,70,00,70,00,3a,00,2f,00,\ 2f,00,31,00,30,00,2e,00,39,00,36,00,2e,00,31,00,34,00,2e,00,31,00,32,00,5c,\ 00,50,00,48,00,58,00,42,00,5a,00,31,00,31,00,00,00,00,00,00,00,00,00,00,00,\ 01,04,01,82,dc,00,14,0c,03,3f,00,00,01,00,01,00,ea,0a,6f,08,64,00,01,00,07,\ 00,58,02,02,00,02,00,58,02,02,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,5c,00,5c,00,69,00,70,00,70,00,3a,00,2f,00,2f,00,31,00,30,\ 00,2e,00,39,00,36,00,2e,00,31,00,34,00,2e,00,31,00,32,00,5c,00,50,00,48,00,\ 58,00,42,00,5a,00,31,00,31,00,00,00,00,00,00,00,00,00,00,00,01,04,01,82,dc,\ 00,14,0c,03,3f,00,00,01,00,01,00,ea,0a,6f,08,64,00,01,00,07,00,58,02,02,00,\ 01,00,58,02,02,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00Thank you in advance...
trancexx Posted March 13, 2010 Posted March 13, 2010 Read->change->write. What exactly is the problem? ♡♡♡ . eMyvnE
Shadowpp Posted March 15, 2010 Author Posted March 15, 2010 (edited) My problem is that I cannot figure out how to Read->change->write the specific values in the key. There are 6 values contained within the key of over 6000 characters that I wish to change. While I know exactly which ones I want to modify I cannot determine how. It doesnt seem that I can use a stringsplit or search for a pattern as the other values (the ones I am not interested in changing) can be anything. The values I wish to change are in a fixed position, so using this code I can find the 95th value (0x01) and I can set the value of the variable $result but I cannot determine how to write that value back. $sHexTextStr= RegRead ("HKEY_CURRENT_USER\Printers\DevModePerUser", "ipp://10.96.14.12/ipp/PHXBZ11") $bBinary= Binary('0x'&$sHexTextStr) $result = BinaryMid($bBinary, [b]95[/b],1) ConsoleWrite($result&@CRLF) set $result = "0x02" Once changed, I think to write it all back to registry would be: RegWrite("HKEY_CURRENT_USER\Printers\DevModePerUser","ipp://10.96.14.12/ipp/PHXBZ11","REG_BINARY",Binary('0x'&$sHexTextStr)) I am not even sure if any of this is close....actual help would be appreciated. Edited March 15, 2010 by Shadowpp
PsaltyDS Posted March 15, 2010 Posted March 15, 2010 Demo of REG_BINARY read/modify/write/verify: Global $binData = Binary("0xFEDCBA9876543210FEDCBA9876543210FEDCBA9876543210") Global $binRead, $binWrite ; Initial conditions ConsoleWrite("$binData = " & $binData & @LF) RegWrite("HKLM\SOFTWARE\AutoIt v3\Test", "Bin_Test", "REG_BINARY", $binData) ; Read $binRead = RegRead("HKLM\SOFTWARE\AutoIt v3\Test", "Bin_Test") ConsoleWrite("$binRead = " & $binRead & @LF) ; Modify 8th byte (15th/16th char in Hex) $binWrite = BinaryMid($binRead, 1, 7) & Binary("0xCC") & BinaryMid($binRead, 9) ConsoleWrite("$binWrite = " & $binWrite & @LF) RegWrite("HKLM\SOFTWARE\AutoIt v3\Test", "Bin_Test", "REG_BINARY", $binWrite) ; Re-read $binRead = RegRead("HKLM\SOFTWARE\AutoIt v3\Test", "Bin_Test") ConsoleWrite("$binRead = " & $binRead & @LF) oneLess 1 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
darkjohn20 Posted March 17, 2010 Posted March 17, 2010 (edited) StringReplace()?Nevermind, just realized that he only wants those specific values changed. Edited March 17, 2010 by darkjohn20
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now