We help IT Professionals succeed at work.

Clearing Cookies & Temporary Internet Files in Roaming Profiles.

I have a file server that houses roaming terminal server profiles for each Active Directory user.  When the users logs in to either Terminal Server, the profile is copied down to the server.  For some users, this process takes 5 minutes.  These users have 100+mb of temporary internet files, and, in some cases thousands of cookies.

Anyone have a script to run at login, or group policy settings, etc... to automatically clear these files?  This would save backup/restore time, and speed up login.
Comment
Watch Question

Select User Configuration->Windows Settings->Internet Explorer Maintenance (right click, and put in Preference Mode), and finally click Advanced. Then choose Internet Settings, then Advanced settings. There should be a setting for Delete Saved Pages when Browser Is Closed.

========================

More information and regkeys:

"Internet Explorer URL Action and Advanced Security Settings in Group Policy"
http://technet2.microsoft.com/windowsserver/en/library/c07587ec-4a60-4bca-8508-29a4296b72121033.mspx?mfr=true

========================

Empty Temporary Internet Files Folder When Browser is Closed

Preference Key Name:
HKCU\Software \Microsoft\Internet Explorer\Cache \Persistent

Policy Key Name:
Software\Policies \Microsoft\Windows \CurrentVersion \InternetSettings\Cache \Persistent

=======================

Author

Commented:
How can this be done using Group Policy?  Also, I need their existing cookies and temporary internet files to delete.
To do it via GPO use:
"Internet Explorer URL Action and Advanced Security Settings in Group Policy"
http://technet2.microsoft.com/windowsserver/en/library/c07587ec-4a60-4bca-8508-29a4296b72121033.mspx?mfr=true

I have this script which is set as a logoff script for all users at client's site. It takes a while to run the first time, and almost nothing thereafter. It's solved a lot of their roaming profile issues.

HAND

MidnightOne


rd "%userprofile%\local settings\temporary internet files\content.ie5" /s/q
rd "%userprofile%\local settings\history\history.ie5" /s/q
del "%userprofile%\cookies\*.*" /s/q/f
del "%temp%\*.*" /s/f/q
del "%tmp%\*.*" /s/f/q

Open in new window

Commented:
Hello,

Thanks for script, particulary interesting for me in RDS with roaming profile environements.

But in windows 2008R2 / Win7 i think it's better to use %userprofile%\AppData\Local\Microsoft\Windows\Temporary Internet Files\

Regards,

Chris.