VBScript Registry - Change Settings
Our mission is to create a script that will change values in the registry. Once you have mastered the technique, the scope for registry scripting is nearly as big as the registry itself. The mission will be tricky, success will depend on attention to detail.
To complete our mission, we are going to need to combine skills from VBScript (WSH), Windows 2003/8 (Windiff, the registry (Regedit, Active Directory (LDAP). In truth, I selected this key for you to experiment with scripting the registry using a relatively harmless key.
The scenario is this, we need to control the follow setting in the browser - 'Empty Temporary Internet Files folder when browsing'.
WINDIFF and REGEDIT
The method we are going to use involves exporting a section of the registry. In fact we will export the section twice, once with setting on (checked) and once with the setting off (unchecked).
Now we are ready to open the WINDIFF utility an detect the difference in the two files. Once we locate the differences between the checked and unchecked files we will know where in the registry the setting is located.
Here is the Technique I Used:
The Goal - Delete All Temporary Files
Remember that the Goal was to make sure that the Internet Explorer deleted all temporary files on exit. We want a script which does the same as manually clicking, IE, Tools, Internet Options, Advanced, Security, Empty Temporary Internet Files on Exit.
RegWrite - WSH Method
The actual scripting part is controlled by a method called RegWrite. Once WINDIFF told me the correct registry path, it is a matter of taking care with the syntax and using REG_DWORD (not REG_SZ).
There was one last trap to get the tick to appear in Internet Explorer you need to set Persistent = 0. The logic is we do not want any files saved - hence zero. "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Persistent"
' VBScript - contact firstname.lastname@example.org
I like the Permissions Monitor because it enables me to see quickly WHO has permissions to do WHAT. When you launch this tool it analyzes a users effective NTFS permissions for a specific file or folder, takes into account network share access, then displays the results in a nifty desktop dashboard!
Think of all the frustration that this free utility saves when you are troubleshooting authorization problems for users access to a resource. Give this permissions monitor a try - it's free!
Registry Export Script - Kindly Sent by Michael Einar Reynis
'strCommand = "regedit /e <FilePath> <RegKey>"
Summary of VBScript Registry Settings
My greatest joy would be if you used this example as a template for changing your registry settings automatically using VBScript.