/build/static/layout/Breadcrumb_cap_w.png

Need vbscript to modify the binary value

Hi,

Any body has VB script to modify the binary value in registry.

I have the below key:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections]
"SavedLegacySettings"=hex:3c,00,00,00,1d,00,00,00,07,00,00,00,00,00,00,00,00,\
00,00,00,25,00,00,00,68,74,74,70,3a,2f,2f,61,75,74,6f,70,72,6f,78,79,2e,65,\
75,2e,63,73,63,2e,63,6f,6d,2f,70,72,6f,78,79,2e,70,61,63,00,00,00,00,00,00,\
00,00,b0,98,1a,ad,08,75,ca,01,01,00,00,00,ac,10,64,46,00,00,00,00,00,00,00,\
00

I need to modify the 9th value in the first line that is from 07 to 03.

Now the new value looks should be:
"SavedLegacySettings"=hex:3c,00,00,00,1d,00,00,00,09,00,00,00,00,00,00,00,00,\
00,00,00,25,00,00,00,68,74,74,70,3a,2f,2f,61,75,74,6f,70,72,6f,78,79,2e,65,\
75,2e,63,73,63,2e,63,6f,6d,2f,70,72,6f,78,79,2e,70,61,63,00,00,00,00,00,00,\
00,00,b0,98,1a,ad,08,75,ca,01,01,00,00,00,ac,10,64,46,00,00,00,00,00,00,00,\


Thanks
Sanhivi

0 Comments   [ + ] Show comments

Answers (1)

Posted by: He M u 12 years ago
Senior Yellow Belt
0
Hi

Check this out ;)


const HKEY_CURRENT_USER = &H80000001
strComputer = "."

Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")

'Define byte's array
Dim bArray

strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections"

'Fill array with values of the key;
'array elemnts starts from 0 an up,
'so I need to change bArray(2) element's value

objReg.GetBinaryValue HKEY_CURRENT_USER, strKeyPath, "DefaultConnectionSettings", bArray

'Changing value
bArray(8) = 3

'Write infromation back
objReg.SetBinaryValue HKEY_CURRENT_USER, strKeyPath, "DefaultConnectionSettings", bArray

Set objReg = Nothing
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ