When is a Windows User's Temp directory cleaned out?

30

1

When does Windows clear this directory? The only time it seems to is when running disk cleanup tool one is given the option..

markmnl

Posted 2011-06-14T06:07:47.290

Reputation: 655

Question was closed 2017-01-20T14:55:02.150

Answers

35

Windows never automatically cleans the %TEMP% directory by default. In Windows 10 you have to enable this feature in Settings, and with earlier versions you must delete the files yourself or use programs like Disk Cleanup or cCleaner.

Developers using temporary files are expected to clean up after themselves.

Patches

Posted 2011-06-14T06:07:47.290

Reputation: 14 078

I didn't enable anything and I know mine disappear. I will see if I can observe the schedule. – Palu Macil – 2019-02-14T05:44:30.730

A lot of the code examples I've seen that use temporary files don't clean up after themselves. Good thing normal users don't care about disk space, amiright... – Alexander – 2019-04-27T22:42:35.450

27"Developers using temporary files are expected to clean up after themselves."...and the crowd breaks out laughing (not at you, but that is like inexpensive lawyers and the tooth fairy...figments of your imagination). – KCotreau – 2011-06-14T13:50:31.120