I thought of the group policy object method on my own the other day, but I'm having a problem with it. I have it run a batch file at shutdown, which is:
echo Script ran at last shutdown. > c:\users\karl\desktop\shutdownlog.txtC:\PROGRA~2\CCleaner\ccleaner.exe /auto
Note that these commands are correct individually. The first line is so I know the batch file was actually run. It drops a text file on my desktop, which I delete afterward. If the file is there, the script ran at shutdown. The second line is PROGRA~2 because I'm running 64-bit Windows 7 RC and the actual folder is "C:\Program Files (x86)\CCleaner". It's definitely correct because I can paste the line into a command prompt and it runs CCleaner. Each line does exactly what it should do.
And I know that the script is running at shutdown because it's dropping the text file on my desktop every time. But it's not cleaning. After restarting a few times, I ran CCleaner and analyzed, only to find I still had a gig of trash on my drive. I'm at a loss as to why.