deltree /y c:\windows\temp
Looks like you've discovered another potential 'gotcha' lurking in the hidden corners of Windows, ready to jump out and bite at the worst moment.
If only thing were easy --- Windows also sinks it's claws into certain files and any attempt to delete them fails. If Windows is running when you attempt to rid your system of temporary files, not all will be erased.
So --- Now we're in a pickle! Put the command in StartUp, and not all files get deleted, but put it in AUTOEXEC.BAT and some files get erased inappropriately.
I created a CLEANUP.BAT file that I only run in DOS. Since I run it, I have no worries about automation throwing grit into the gears, and since it runs in DOS, everything gets erased.
I'll cut-and-paste my CLEANUP.BAT file:
@ECHO OFF REM Delete unwanted files and replace their root folders DELTREE /Y C:\WINDOWS\TEMP MD C:\WINDOWS\TEMP DELTREE /Y C:\WINDOWS\COOKIES MD C:\WINDOWS\COOKIES DELTREE /Y C:\WINDOWS\TEMPOR~1 MD C:\WINDOWS\TEMPOR~1 ERASE E:\WIN386.SWP
Note: I use DOS 8.3 file names because I run this in DOS and Windows support for long file names is not available.
Anyway, your post points out a source of difficulty which would be extremely hard to locate for the average user. Imagine, everything's going well, and now, mysteriously, it doesn't. No signs. No messages. Just stopped. An 'Oh-shit' moment.
Cheers, PW. |