Topic: Read, Modify, Write Binary registry value  (Read 1601 times)

0 Members and 1 Guest are viewing this topic.

Read, Modify, Write Binary registry value
« on: April 30, 2015, 05:15:47 AM »

apinux

  • Jr. Chef
  • **
  • Date Registered: Nov 2011
  • Posts: 51
Is there a way in WinBuilder scripting to read the following binary values into a variable and change the 3rd byte from 04 to 00 and then write the modified binary values back to the registry?

HKEY_CURRENT_USER\Control Panel\Desktop\UserPreferencesMask = binary values (90,22,04,80)

Thanks!

Re: Read, Modify, Write Binary registry value
« Reply #1 on: April 30, 2015, 06:19:53 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7386
Hi apinux,

yes possible,
after RegRead, ... %t%
StrFormat,REPLACE,%t%,",",-,%t%
or
StrFormat,REPLACE,%t%,#$c,-,%t%
to get rid of possible winbuilder comma bug (check with different versions to see if it works ok, Echo,%t%

there is Loop Command, which will help you assign a variable for each value with a counter,
when there is no - than Loop,Break ;)

after all, - back to comma, and regwrite,

**** At the end test with both wb versions **** when there is comma, there is potential wb bug  :wink:

**
At Macro Library,
Call,CompareVersions
works with very very very very very similar logic,
use
Call,CompareVersions,3.12.0.600,3.3.0.380,CalculateResult1
Echo,%CalculateResult1%
to see how it works on Log,

this command splits 3.12.0.600 and 3.3.0.380 to 4*2 variables (which is what you are after), comparing one by one .......

++
I use AgentRansack to see how we use commands ;)
You can quickly find other Loop examples at Gena  :thumbsup:

**
Additional note:
UserPreferencesMask is as you already know an interesting value,
it may take your interest to check
Gena\Components\Tweaks Explorer\"Tweaks and Settings" plugin ( Exp 1Tweaks ) to see how it was arranged there  :cool:

++
Just came to my mind, maybe you can also read 3rd byte by a StrFormat command,
StrFormat,POS,
StrFormat,LEFT,
StrFormat,Split,
maybe useful

++++
Sorry, I can not focus on this without having time, I hope above helps.

After you achive, post around, it would be a nice code to have at hand  :smile:

:turtle:

Re: Read, Modify, Write Binary registry value
« Reply #2 on: October 20, 2015, 12:05:29 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7386
Hi apinux,

We now have new syntax,

Call,RegWriteBinaryBit

Check here:
http://theoven.org/index.php?topic=1438.msg17214#msg17214

 :turtle: :xmas-beer:

 

Powered by EzPortal