Autoexec.bat windows/temp file removal command

BigDog2k

Member
Jun 7, 2000
96
0
61
A while back someone posted a script that you can put into your autoexec.bat file to clean out your windows temp directory when you boot up. anyone know what that is

Thanx
Shawn
 

Slikkster

Diamond Member
Apr 29, 2000
3,141
0
0
Hawkeye just had a minor typo and IsOs's command WILL work IF the path to deltree is set beforehand, or if, instead, you type out the complete path to the command. Here's how I do it:

c:\windows\command\deltree /y c:\windows\temp\*.*

This assumes you've installed Windows to the default c:\windows folder.

You can, as IsOs did, leave out the "\*.*" because Windows will automatically recreate the c:\windows\temp folder at startup if it's missing. That's just a matter of choice. The difference between IsOs's version and mine is that mine empties out all files and subfolders of the c:\windows\temp folder, while his deletes the Temp folder itself and all it's files/subfolders.

I also use the line:

c:\windows\command\deltree /y c:\temp\*.*

because I have a c:\temp folder in addition to the c:\windows\temp folder.