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

1 Response to “VB Script :Write a binary value in registry”


  1. 1 Vinayani June 7, 2011 at 6:17 pm

    Thnak you


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s





%d bloggers like this: