Deleting contents of WINDOWS\TEMP folder

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

DonW

Thread Starter
Joined
Aug 18, 2000
Messages
94
In my autoexec.bat I placed the statement:

@IF EXIST C:\WINDOWS\TEMP\*.* DEL C:\WINDOWS\TEMP\*.*

I did this for obvious reasons....to empty my TEMP folder on bootup. My question is this:
I assumed that if the folder had any contents that they would be deleted automatically without being prompted. However, that doesn't happen. I continually get prompted for confirmation when there are files in that folder. Does anyone know of a way to eliminate the promping? The DEL and ERASE commands don't offer a switch that bypasses prompting. What's strange tho is the fact that there IS a switch to force the command to prompt you first before deleting the files....which is kind of redundant since it prompts me anyway even without the switch. This post should probably be in the DOS forum so I apologize. I am running Win98SE and would like to use a simple DOS command at bootup to empty my WINDOWS\TEMP folder.

Any ideas?
 

TonyKlein

Malware Specialist
Joined
Aug 26, 2001
Messages
10,392
You ought to include 'smartdrv' as well:

@ECHO OFF
smartdrv
DELTREE /Y C:\WINDOWS\TEMP\*.* > NUL


But I don't advise it, as you'll have problems installing certain programs.

Some programs put stuff in your temp folder, that they need after reboot to complete the installation.

You can delete your temporary internet files, history, cookies, everything you like at startup, but don't do your temp folder.

Make a little batch file with these lines in it, and activate it through a desktop shortcut.
Add CLS as a last line, so that the DOS window will close after running the batch file.

Good luck,
 
Joined
Oct 29, 2001
Messages
2,056
i use a bat file written by fred langa and distributed in his newsletter, you can run it from an icon, in your autoexec, etc

very fast, also very aggressive, but you can modify it to suit your needs

fred has an excellent, and free!, newsletter twice a week on a variety of computer topics

here's the LangaList link for the CleanAll.bat file
 

Nix

Joined
Dec 2, 2001
Messages
102
I thought the CLS command in DOS CLears Screen providing you with a prompt on a clear screen ?
 
Joined
Jan 20, 2000
Messages
2,984
The CleanAll.bat from the Langa list is an excellent way to clear your temp folder and you can also add it to the RIGHT click menu of the Recycle Bin. Just RIGHT click the Recycle Bin and the CleanAll.bat is a choice. You can find this also at jbcalg's link posted above for the Langalist.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Top