Lester said:
The practice i use here is, if \temp\ has files/folders
present, you can remove the empty ones safely. If they have
some substance (in kb) I don't remove them as they can be
used by the associated program or installer. Sometimes the
programs will appear to work fine, but if you ever need to
remove an associated application- and it doesn't find it's
temp file/folder, you'll receive a "installer cannot find
script file" error.
Well-mannered programs don't purposely keep any temp files. The only time
you should be wary of deletinmg a temp file is if you are in the middle of
an installation. Some installations work in two parts. The first part
concludes by saving files in the temp folder, then rebooting. The second
step starts automatically after rebooting and needs to find those files
there (and then deletes them when it's done).
Other than doing it automatically when rebooting (that would interfere with
installations like the kind I described), it's always safe to delete the
contents of the temp folder. Because it's safe to delete any temp files that
aren't open and in use by an application, and since Windows won't let you
delete open files, it's safe to (try to) delete them at any time. If any
fail to delete because they're open, they'll either be deleted automatically
when the app using them closes, or you'll get them the next time you delete
manually.