Archive for the 'VBscript' Category

VB Script :Write a binary value in registry

Here I share with a you a sample script to write a binary value in registry.Its not  easy as you write REG_DWORD ,etc .

const HKEY_LOCAL_MACHINE = &H80000002
strKeyPath = "SOFTWARE\test"
strComputer = "."
iValues = Array(&H01) ‘<-Give the value here .

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
BinaryValueName = "FailureActions"
oReg.SetBinaryValue HKEY_LOCAL_MACHINE,strKeyPath, BinaryValueName,iValues

 

Note: For testing this script make sure ‘HKLM\Software\test’ key present already.

Advertisements

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 98 other followers

Blog Stats...

  • 111,663 hits
Advertisements