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
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)
Please log in to answer
Posted by:
He M u
12 years ago
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
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.
so that the conversation will remain readable.