Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Thanks to all who answered my previous post! I have been trying to delete my c:\windows\temporary internet files by adding the folowing line in either a batch file or in the autoexec.bat (I've been "experimenting" with both ways.)
del c:\windows\tempor~1\*.???
I know you can use *.* but that gives you the annoying "are you sure" question, and the *.??? does not. The problem is that I always get a "file not found" error. And it never deletes the contents of the folder. Deleting the cookies and temp folders this way works fine (except for the access denied error with the cookies folder, because of the index.dat file, if done through a batch file.) However with the temporary internet files folder it just won't work. Can anyone tell me why?

: In autoexec.bat add a line similar (not exact) to:: if exist c:\windows\cookies\*.* deltree /y c:\windows\cookies\*.*
: Use notepad to open autoexec.bat and type in YOUR delete line.
: The next entry will delete EVERYTHING in the temp folder. The * = any, therefore delete any(name).any(extension). You could be specific, i.e., "cookie.dat" (or however the cookie is identified)
: if exist c:\windows\temp\*.* deltree /y c:\windows\temp\*.*

Temporary folder is a system folder.. You have to remove the S attribute...
You batch file should go:
attrib -s tempor~1
echo y| deltree c:\windows\tempor~1

PS Don't forget to change the attribute on the Cookies Folder itself, as it is probably checked as a System folder, change it to Archive.

Jacky the *.??? is not a valid command, the *.* is called a 'wildcard' meaning all files and if you only want certain files removed you can use, for example, *.txt
I had the command in my Autoexec.bat and it just did it without conferring with me and just kept booting.
There may also be a program blocking it from being deleted as well like Realplayer G2 [and the new version] or as I found out recently Norton Cleansweep which monitors the cache folders, You could try deleting from Command Prompt Safe Mode [F8], this has worked for me with stubborn files in the past.

Thank you all!
Ronnie Ratt: *.??? not valid? It works perfectly fine with the cookies and temp folders. I get no errors (as long as they are not already empty, which gives a file not found error), no big deal. I know that *.* is typically the way you do it, but I was getting the "are you sure?" at every bootup and needed to always answer yes. Not something I wanted to have to do at every startup. I knew "?" is also a wildcard so I thought I'd try it for the extention and it worked fine and does not ask me to confirm anything. It just goes ahead and deletes everything. I just have to get it to work for the temporary internet folder! Thanks again for responding.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |