Every applications nowadays seems to create temp-files without feeling the need to clean up after them-selfs. So I need to take care of this matter.
At least most applications dump the temp-files in the appropriate temp-folder, that is being provided either by the windows environment or via special folders.
OK, but how do you get rid of this junk easily? The answer is simple: just setup an appropriate policy.
In order to do so, you first should create a little script:
cd %temp% rd . /s /q cd %windir%\temp rd . /s /q
Call this script for e.g. del_tmp.cmd
and place it in %windir%\system32\GroupPolicy\User\Scripts\Logoff
.
Next startup an instance of gpedit.msc
and go to user-settings\windows-settings\scripts
. Here you can edit which scripts should be run at logon/logoff. Obviously we want our script to run at logoff.
OK, not everything is set to clean-up with every logoff.