I've been poking around trying to get Disk Cleanup to run as my Windows XP Pro SP2 machine shuts down.
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 3GB of temporary files and I'd like to prevent this build up without having to remember to do anything on my part.
So far, I have attempted to automate Disk Cleanup using a user logoff script in the Group Policy Editor (as per these instructions using cleanmgr /sageset:1 and cleanmgr /sagerun:1), but it doesn't seem to be executing correctly.
In particular, I'm seeing log entries such as "Execution of GPO scripts has timed out and have been terminated." that suggest the script isn't completing successfully. Also, when I ran the command that the script contains left my computer I while, I found on my return it had shutdown and not completed the Disk Cleanup.
Can anyone help me understand why Disk Cleanup doesn't appear to be executing correctly, or suggest a better approach?
EDIT: A bit of fiddling around and it seems that the timeouts were caused by the large amount of temp files and the amount of old files to compress. I've not been able to reliably duplicate the shutdowns I've been getting when running the cleanmgr command, but suspect it was also related to the timeouts.
However, Disk Cleanup doesn't seem to be cleaning C:\Documents and Settings\Chris\Local Settings\Temp\ as I expected it would. Whilst all other temporary files/folders appear to be cleaned, this particular folder is seemingly untouched
EDIT1: As I suspect that Disk Cleanup simply isn't meant to clean that folder (although, I don't understand why that wouldn't be the case), I have asked a more general question about how to automatically delete the temporary files in Local Settings\Temp