My c:\windows\temp directory keeps filling with temp files. I can and
do manually delete them, but how can I delete them more easily?
Is there an option somewhere?
In W98 I can make a batch file with:
deltree c:\windows\temp /Y
md c:\windows\temp
But how to do it in XP?
Do a similar thing, using the lines
@Echo off
CD /D C:\WINDOWS\TEMP
DEL /Q /F *.* >NUL
FOR /D %%i in (*) DO RMDIR /S /Q "%%i" >NUL
Exit
which will change to the directory, do a delete of everything in it in
Quiet mode (/Q, so not asking questions), including read only files /F
and sending its output to the null black hole. The RMDIR line will
clear out subdirectories - do it this way rather than the alternative of
using a /S switch in the DEL, because it won't get in difficulty if
something has made folder there already with files active in it
You might usefully include a set
CD %HOMEPATH%\Local settings\Temp
DEL /Q /F *.* >NUL
FOR /D %%i in (*) DO RMDIR /S /Q "%%i" >NUL
before the exit, to clear the temp folder in your Profile, which is one
a lot of things will be using
Then right click on Start, take Open, Open up Programs - Startup and put
the file in there to run automatically