Lots of old directories & files in c:\windows\temp

G

Gordon Staley

I noticed that I am accumulating a lot of directories in c:windows\temp.
We're talking LOTS (over 67,000 folders with 2-3 files in each). This all
started back on the 26th of January. I figured this out by looking at the
file creation dates using the DIR command at the command prompt.

Most of the directories are 32 character hex like this:
DFFEA65F96BD46b0A8F5C8C31D6BAE0C, containing two files, one ending in ".HPJ"
and the other ending in ".RTF" with the same filename as the ".HPJ" file.

Two questions:
1) How best to delete these folders and their files?
- rmdir doesn't seem to allow wildcards
- going through explorer is tedious
2) Any idea what is causing these directories with the two files (.HPJ,
..RTF) to be created?
- I've traced the start to the 26th of January
- Nothing is obvious from the system restore log

Thanks for your help. This is really a vexing problem.

Gordon Staley
 
J

JTW

Although programs should clean up after themselves, they don't always
do this. The temp directories, the one you've already noticed, and the
one located under the "\Documents and Settings\[User]\Local
Settings\Temp" can accumulate thousands of files and folders if not
regularly cleaned up. The below script is a good script example of how
to remove the data, and it can be scheduled from the Task Scheduler to
run as needed (changing line 3 as needed).

*********File Start: CleanTemp.vbs***************

Option Explicit
'http://www.Dx21.com

Const TempDir = "C:\Windows\Temp"

Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")

ClearDir TempDir

Sub ClearDir(Folder)
Dim objFolder, colFolders, colFiles, objFile, objDir

Set objFolder = objFSO.GetFolder(Folder)
Set colFolders = objFolder.SubFolders
Set colFiles = objFolder.Files

On Error Resume Next

For Each objDir In colFolders
ClearDir objDir.Path
objDir.Delete True
Next

For Each objFile In colFiles
objFile.Delete True
Err.Clear
Next

Set objFolder = Nothing
Set colFolders = Nothing
Set colFiles = Nothing
Set objFile = Nothing
Set objDir = Nothing
End Sub

Set objFSO = Nothing
 
G

Gordon Staley

Thanks for the cleanup script. That did the trick. It allowed me to be able
to look at the data more closely. To be careful I brought the system up in
safe mode to do the cleanup.

I wish I could figure out what is generating all these directories. They
are populated in one of three ways:
- a pair of .HPJ and .RTF files as mentioned in the base post
- examples: IDENT, IEXPLORE, ODBCINST, CONNECT, MSDRAW
- a .HLP file
- examples: connect, Wab, iexplore, update, SIGNIN, mobsync, ident
- a .CAB file
- examples: IENT_1, IENT_6

They also seem to get generated in spurts. They show up at about a five
minute interval. There have been as many as 28 directories created and as
few as one. There seems to be about 80 directories per hour getting
generated.

Any idea what might be causing this? I'd like to elminate the source of the
problem if possible.

Thanks again,
Gordon Staley
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top