Discussion Locked

How to Delete EVERY users temporary inet files

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have some computers which have had dozens of people login and use Internet Explore. We're using Windows XP with everyone sharing their %temp% folders. Internet Explorer, however, is caching to each users profile

I want to clear their temporary internet folder and history folder but I need to automate the process so it can be done with a batch file.

I thought about C:\Documents and Settings\*\Local Settings\History
Notice the wildcard (*) in the path. This does not seem to work. I'd like to open a discussion on methods for doing this. Any ideas?

It really needs to work in a batch file because I'd like to run this on multiple computers scheduled overnight. After deleting these files along with Recycle Bin and Prefetch the batch file would restart the PC and run Defrag. I've got a handle on all these items but having a problem manipulating each user profile using some kind of wildcard or automation.
This is a corporate environment so freeware like CCleaner won't be a viable solution. But I'm open to all ideas.

3 replies

by ic-it

It is meant to clean the Windows temp and prefetch directories and all user profiles. Just do a cut-n-paste, then save as a bat file.

rem @ECHO OFF
SET SRC1=C:\Documents and Settings
SET SRC2=Local Settings\Temporary Internet Files\Content.IE5
echo About to delete files from Internet Explorer "Temporary Internet files"
FOR /D %%X IN ("%SRC1%\*") DO FOR /D %%Y IN ("%%X\%SRC2%\*.*") DO RMDIR /S /Q "%%Y"
echo About to delete files from "Windows\Temp"
cd /d %SystemRoot%\temp
del /F /Q *.*
echo About to delete files from "windows\prefetch"
cd /d %systemroot%\prefetch
del /f /q *.*
@echo Y|RD /S ""

by knowledgebased

This works great.

I'd like to make a copy of each folder/files and maintain the directory structure so that if something goes wrong I can restore their system easily because the copied files are still organized by their login folder

I am currently working on this right now. Let me know if you've already come up with something like this.

This discussion is closed to new replies.