1

Is it possible for one of you to write a script for removing the temp files during logout for all users? (or server during restart)

Or this script can be scheduled alternate weeks.

As unnecessarily it will fill up the C drive otherwise.

1 Answers1

0

You don't want to do this or your windows updates and any other software installation needing a reboot to finish installation will fail. We tried something similar and regretted it...
I would recommend that you create a .bat file that you train your users to run after they boot up and before they open any files/programs...
You could start with:

cd %temp%    
del /F /S /Q *.*

If you want to delete other temporary locations, you would need to add them according to your environment...

Scott Lundberg
  • 2,364
  • 2
  • 14
  • 22
  • 1
    There's a very easy way to avoid the problem you encountered - check each files Accessed Date attribute, and only delete files that have not been accessed in X weeks/months. – Izzy Sep 23 '09 at 15:44
  • 1
    @Izzy: Maybe I missed something, but when trying that, I noticed that some installers did not change that attribute and it was still set a long time in the past, yet had just been added to the hard drive recently... – Scott Lundberg Sep 23 '09 at 16:38
  • Then check on the parent folders Accessed date/time. In fact, if it was me, I'd check for the Accessed, Created, and Modified dates, and if any of them were within the last 3 months I'd leave it. – Izzy Sep 24 '09 at 15:53