Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Need a script that will delete a users Internet temp folder on Windows 2000 and XP

Posted on 2004-10-26
Medium Priority
Last Modified: 2012-05-05
I have been noticing more often that viruses are being found in the Internet temp folder located at c:\documents and settings\%username%\local settings\temporay internet files.  I would like to have a script that can be executed either by scheduled events or by logon/logoff that deletes all of the files located in that folder.  Can someone give me a complete script solution to do this?  
Question by:murryc
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 12412334

Have you tried Disk Cleanup?  You can add that as a scheduled task to run every day if you need it that way.  It would be more easier than having to write a script of some sort.

Hope that helps!


Author Comment

ID: 12412434
dev8..can you run that task with switches so that it does not prompt the user for anything?  I am looking for a fast, simple, transparent solution that the user does not even know is working in the background.

Expert Comment

ID: 12412444
Microsoft has DelProf.exe.  It Is WAY cool, and you can run it remotely:

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.


Expert Comment

ID: 12412489

Accepted Solution

dev8 earned 2000 total points
ID: 12412546
Me again,

To setup up:

go to run,

type in cmd

then type cleanupmgr.exe \sageset:1

From here you will select what you want to cleanup.

Then add a scheduled task

add disk cleanup as a scheduled task and add it to run whenever you want

Before it finishes, click the option to select advanced settings

You should see a "run" line like so:


simply add /sagerun:1 at the end:

C:\WINDOWS\system32\cleanmgr.exe /sagerun:1

This will automatically run diskcleanup for you in the background without user interaction!

Just refer to the article i provided earlier!


LVL 20

Expert Comment

ID: 12415754
PAQ on the subject here - worth a look courtesy of Pete Long et al,

Solution Title: Batch file to delete temporary internet files and others

Deb :))
LVL 96

Expert Comment

by:Lee W, MVP
ID: 12418100
Why not just configure outlook to Empty Temporary Internet Files when browser is closed? - Internet Control panel, near the end of the options listed under "Advanced" tab  

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Geo-targeting is the practice of distributing content based on a person’s location, as best as you can determine it. Let’s look at some ways you could successfully use this tactic. The following tips and case studies could lead to meaningful results.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

609 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