Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group Policy - Delete Temporary Internet Files

Status
Not open for further replies.

obryant32

IS-IT--Management
Feb 20, 2003
66
US
I was wondering if there was a way to configure Group Policy to automatically delete temporary internet files upon logoff. I know there's a setting under the advanced tab in internet explorer that empties them upon closing the browser. If I could get Group Policy to automatically do that I'd be satisfied. Anyone have any ideas?
Thanks,
Matt
 
You can do it with a logon or logoff script from within Group Policy.

If you do it as a logoff script, it won't take effect until the next time they log on. If you do it as a logon script, when they next open IE the setting will be active.

Code:
'==========================================================================
'
' NAME: EmptyTempInternetFilesonExit.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' DATE  : 6/3/2004
'
' COMMENT: <comment>
'
'==========================================================================

Dim path
Set WSHShell = Wscript.CreateObject("WScript.Shell")

path = "HKCU\Software\Microsoft\Windows\"

WSHShell.RegWrite path & "ShellNoRoam\MUICache\@inetcplc.dll,-4750","Empty Temporary Internet Files folder when browser is closed","REG_SZ"

WSHShell.RegWrite path & "CurrentVersion\Internet Settings\Cache\Persistent","0","REG_DWORD"

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
The below thread has all the info you need:

thread931-826016

 
tfg13, thanks for directing to that thread. I reviewed it and found that techdaddy and I both found the same reg key, only difference is that I found an additional one that seems to only get created the first time you set the machine to clear the cache. If the user has at some point set to empty the deleted items then thye will already have it, otherwise it needs to be created.

I am referring to:
ShellNoRoam\MUICache\@inetcplc.dll,-4750","Empty Temporary Internet Files folder when browser is closed","REG_SZ"


I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Hey Mark, thanks for the info.

I tried setting up a batch file that used your script but it doesn't actually change either of those registry keys. Does it only work on startup or logoff? Not sure why it didn't work. Any insight?

Matt
 
You need to save the file with a VBS extension.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top