Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Temp Folder 1

Status
Not open for further replies.

deadriver

IS-IT--Management
Dec 28, 2004
10
0
0
US
Hello-

My C:\Windows\Temp folder has over 800,000 files consuming about 4GB. What is the easiest way to delete the files and recover the space?

When trying to delete using explorer, I get the hour glass for hours, while it enumerates the files.

What could the cause of so many temp files?

TIA!

 
Go to the cmd (command) prompt and navigate to the temp directory as follows;

C:\windows> cd temp and press ENTER

C:\windows\temp> del *.* /S and press ENTER

This will delete all files and files in subdirectories. Bare in mind some files will not be deleted since they are being kept open by an application. Hope this helps.
 
itsp, what does the /S command do?
I know that it cannot delete files that are in use, but by any chance, does he /S stop it from asking to delete hidden files or files like thumbs.db.

I hate it when I have to delete something that can take hours and it would stop at 10% just because it wants confirmation to delete thumbs.db (for example).
 
The /S option allows you to delete files in subdirectories and the subdirectories themselves. Unfortunately this will not work on hidden files.
You can remove the hidden file attributes on files by issuing the attrib -h <filename>
Hope this helps.
 
Actually, the DEL command can delete hidden files. You can use /A (attributes) to select which files having certain attributes should be deleted. DEL /? will give you more help. You could probably use /F (force delete of read-only files) and /Q (quiet mode) to avoid the prompts.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top