Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 11 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
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...
It's a restricted key. REG and regedit can access it directly because tehy ask for more privileges whereas WMI, by default, doesn't. You might be able to get around this by asking for more tokens in WMI. I tried it with "security" but I think you also need "registry" privileges.
I tried it like this:
Set objRegistry = GetObject("winmgmts:{(security,backup)}.rootdefault:StdRegProv")
It still won't work so there is still a privilege missing. If you look at the values "permissions" you will see that it is "protected/read" and script usually runs with low privileges.
Here's somthisng that you might want to try as long as yo have local admin privlidges you can make registry changes to a list of of machines I use this simple script i've made changes up to 75 machines at one time with no poblem.
File 1: REG-ADD.cmd.txt (add the registry entry)
File 2: Hostnames.txt (place either IP or machine name both methods works fineuploads/50517/Reg-Add.zip)
This topic is 11 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.