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

Posted on 2005-04-14
Last Modified: 2008-12-15
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

Question by:Jumpnjoe
    LVL 15

    Accepted Solution

    There is a more simpler way to do this.

    Do you want to empty out ALL the temp folders?  If you do, download this freeware program to do it:

    The Temp folders should be cleaned out periodically as installation programs and hijack programs leave a lot of junk there.  Download CleanUp! (Alternate Link if main link don't work - ) and install it.  Run CleanUp! and click on CleanUp! button.  When it asks you if you want to logoff, click on Yes.
    LVL 7

    Expert Comment

    I would create a batch file that would be something like this;

    cd %USERPROFILE%\Local Settings\Temporary Internet Files

    del *.*

    LVL 15

    Expert Comment

    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.
    LVL 11

    Expert Comment

    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!
    LVL 11

    Expert Comment

    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.
    LVL 6

    Expert Comment

    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.
    points on the way
    LVL 1

    Expert Comment

    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
    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.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
    I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension ( This reminded me of questions tha…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now