Link to home
Start Free TrialLog in
Avatar of Jumpnjoe
Jumpnjoe

asked on

How to Delete Temporary Internet Folders from Multiple Accounts on a Single Machine

I have many PCs throughout my network that have multiple users logging into them.  Therefore I have MANY profiles under documents and settings.   I have so many that I am now seeing 40Gb hard drives getting eaten up with temporary internet files.  In particular I would like to delete the following folder:  c:\documents and settings\%username%\local settings\temporary internet folders\content.ie5.  What I would like to have is a simple script that I could run on the hard drive that would delete the folder named "content.ie5" from each profile.  I have admin rights but don't want to spend the time going through 80 or 90 profiles manually.  I will create a GPO that will set the temporary internet files to delete upon exist (from Explorer) but that won't help with those who don't log onto a particular machine again.

Thanks In Advance

ASKER CERTIFIED SOLUTION
Avatar of Member_2_921743
Member_2_921743
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I would create a batch file that would be something like this;

cd %USERPROFILE%\Local Settings\Temporary Internet Files

del *.*

Avatar of davidis99
davidis99

If you're having a problem with temp internet files building up, two things you can do within Internet Explorer to control it are:

1) change the size of the default browser cache.  This is typically set to 5% of the drive by default, which quickly becomes unmanageable by IE.  A browser cache setting of 100MB should be more than enough for anyone of typical internet use.  (Tools, Internet Options, Temporary Internet Files, Settings button), or configure through a group policy).

2) under tools, internet options, advanced, scroll to the security section at the bottom, then check the box for "Empty Temporary Internet Files folder when browser is closed" - this should force IE, when closed by the user, to clean out the broswer cache automatically.
If I had this problem I would probably just use WISE to search for all folders present that are labeled "Temporary Internet Files" and just delete the contents.  You would probably have to put in a variable to continue if a specific file cannot be deleted, but it should work.  You can also do this with VB, C++, or most any other program, but because of your invironment you will probably have to tailor this to your individual needs.  The "batch" file mentioned previously is an example, but would probably only work with the currently logged on user - not all of them!
The batch file, however, if set up under ALL USERS might, in fact, delete those files each time a user logs on (regardless of who it is).  That way the first time all the unnecessary data is delete, and the following logons are kept relatively clean.
greyknight17 Thanks for the link:  I downloaded and installed this little program of yours and I'm sure you know by now, user like it!
Clean Temp files is what we all want and I find this little program a great help in doing this.  
money donated to you through pay-pal and points for your link.
For the rest of you thanks for your commets and suggestions.
d_may
points on the way
Save this into a bat or cmd file (paste into txt file and change the entension to bat or cmd)

c:\windows\system32\cleanmgr.exe /dc /sageset: 11
c:
cd \
cd c:\windows\prefetch
del *.* /q

After running the first time, set your options, including removing temp internet files, after that press ok, the box closes, this saves your settings.

Next thing to do is right click the bat or cmd file and choose edit, after opening change /sageset: 11 to /sagerun: 11

and close and choose yes to save it,

Now you can run this anytime you want to do a complete system cleanup including prefetch data which can cause slowdowns when it becomes full of irrelevant data.