Submitted By: AK

Configures Internet Explorer settings (such as cache size) and deletes IE cookies.

Visual Basic
Edit|Remove
'* *********************************************
'*  Substitute Internet Eraser                 *
'*  Created by: Adam Katulak                   *
'*  Date: Jan-5-2006                           *
'*  Purpose:  This script is designed          *
'*  to set the value for 'days stored in       *
'*  internet history, and the amount of        *
'*  temp files stored in the cache.            *
'*                                             *
'***********************************************
On Error Resume Next
Const HKEY_CURRENT_USER = &H80000001
Const TEMPORARY_INTERNET_FILES = &H20&
Const COOKIES = &H21&
strComputer = "."
 
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

strKeyPathCache = "SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\Cache\Content"
strValueName = "CacheLimit"
dwValueCache = 51200
objRegistry.SetDWORDValue HKEY_CURRENT_USER,strKeyPathCache,strValueName,dwValueCache

strKeyPathCache = "SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Content"
strValueName = "CacheLimit"
dwValueCache = 51200
objRegistry.SetDWORDValue HKEY_CURRENT_USER,strKeyPathCache,strValueName,dwValueCache


strKeyPathHistory = "SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\URL History"
strValueHistory = "DaysToKeep"
dwValueHistory = 0
objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPathHistory, strValueHistory, dwValueHistory

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile(strPath)

Set objShellCookies = CreateObject("Shell.Application")
Set objFolderCookies = objShellCookies.Namespace(COOKIES)
Set objFolderItemCookies = objFolderCookies.Self
strPathCookies = objFolderItemCookies.Path & "\*.txt"

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile(strPathCookies)