I'm trying to find a way to automatically clean/delete the temporary files from
C:\Documents and Settings\user\Local Settings\Temp\ at shutdown/boot on my Windows XP Professional x64 SP2 machine.
The main reason for this is to clean
Local Settings/Temp to remove old junk automatically. (I had thought I had this covered through Firefox settings, but I was only clearing temporary Internet files). Currently, there's around 3 GB of temporary files, and I'd like to prevent this build up without having to remember to do anything on my part.
I'm aware of programs such as CCleaner, but I would ideally like to use a solution that doesn't require additional software (so, I expect, something using a scheduled BAT/CMD script would be what I'm looking for).
One of the potential issues, I believe, is that there may be legitimate files in the
Temp folder that may be needed on the next boot (for software installations or updates, for example) and the perfect solution would be able to distinguish those and leave them until they weren't needed (Note: I realise this perfect solution may not be reasonably possible).
I've already set up Disk Cleaner on a shutdown script, but when cleaning temporary files, Disk Cleaner doesn't clean this particular directory, and so I'm looking for alternative options (see Super User question Automatically executing Disk Cleanup on shutdown for a little more detail).
So, what are my options for automatically deleting the temp files from
C:\Documents and Settings\user\Local Settings\Temp?