VB Script to Modify Registry Keys

3 04 2009

'Script adds or modifies existing values and paths to the windows registry.
'By Christopher Provolt

Const REG_SZ = "REG_SZ"
Const REG_DWORD = "REG_DWORD"
dim objShell

Set objShell = WScript.CreateObject("WScript.Shell")

UpdateRegKey "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\HttpPort", "50", REG_DWORD

Sub UpdateRegKey(strRegPath, strValue, strType)
objShell.RegWrite strRegPath, strValue, strType
End Sub

UpdateRegKey Function Input
'Registry Path,"Value","Type"

'DWORD values should be converted from DEC to HEX