[Webinar] Streamline your web hosting managementRegister Today


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

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:

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.


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 97

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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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…
You do not need to be a security expert to make the RIGHT security. You just need some 3D guidance, to help lay out an action plan to secure your business operations. It does not happen overnight. You just need to start now and do the first thin…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …

612 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