How do I set DWord values in a VBScript?

Need help creating a vb script to merge the following registry info:
 
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Update\Policy]
"EnableJavaUpdate"=dword:00000000
"NotifyDownload"=dword:00000000
"NotifyInstall"=dword:00000000
 
A VBScript can take care of this...
 
OPTION EXPLICIT
const HKEY_LOCAL_MACHINE = &H80000002
dim strKeyPathRoot
dim strKeyPath
dim strComputer
dim strValueName
dim oReg
dim strValue
dim strNewValue
dim dwValue
strComputer = "."
On Error Resume Next
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
    strComputer & "\root\default:StdRegProv")
strKeyPathRoot = "SOFTWARE\JavaSoft\Java Update\Policy"
' this logic allows us to extend to keys below the path
strKeyPath = strKeyPathRoot
strNewValue = 0
strValueName = "EnableJavaUpdate"
oReg.SetDWordValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strNewValue
strValueName = "NotifyDownload"
oReg.SetDWordValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strNewValue
strValueName = "NotifyInstall"
oReg.SetDWordValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strNewValue
 
 
 
Published Thursday, February 07, 2008 1:32 PM by sthompson
Filed under:

Comments

# Pages tagged "dim"

Saturday, February 09, 2008 4:08 AM by Pages tagged "dim"

Pingback from  Pages tagged "dim"

Powered by Community Server (Commercial Edition), by Telligent Systems