Cannot apply change to registry
Posted: Tue May 15, 2007 12:15 pm
Hello all,
I am trying to modify a registry setting on Windows XP with a VBScript and I am unsuccesfull with the following two methods:
Method 1
Method 2
I don't get any error message but nothing is applied. I had the same issue with another setting I was trying to set on Vista and I ended up calling and external .reg file applied from the VBScript...
Incroyable HULK2007-05-15 19:29:21
I am trying to modify a registry setting on Windows XP with a VBScript and I am unsuccesfull with the following two methods:
Method 1
Code: Select all
Const HKEY_CURRENT_USER = &H80000001
Set objRegistry = GetObject("winmgmts:.rootdefault:StdRegProv")
strKeyPath = "SoftwareMicrosoftWindowsCurrentVersionInternet SettingsZone1"
strValueName = "1406"
dwValue = 0
objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue
Method 2
Code: Select all
Dim wshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite "HKCUSoftwareMicrosoftWindowsCurrentVersionInternet SettingsZone11406", 0, "REG_DWORD"
I don't get any error message but nothing is applied. I had the same issue with another setting I was trying to set on Vista and I ended up calling and external .reg file applied from the VBScript...
Incroyable HULK2007-05-15 19:29:21