When does Windows clear this directory? The only time it seems to is when running disk cleanup tool one is given the option..
Asked
Active
Viewed 3.5k times
1 Answers
58
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
- 16,136
- 3
- 55
- 61
-
44"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 Jun 14 '11 at 13:50
-
I didn't enable anything and I know mine disappear. I will see if I can observe the schedule. – Palu Macil Feb 14 '19 at 05:44
-
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 Apr 27 '19 at 22:42
-
1I mean is it so hard @microsoft to delete files older than 1 day or something ? – oren revenge Mar 17 '21 at 09:04
-
@orenrevenge "backward compatibility" -- they aren't going to do something that is likely to break some people's software. Their approach is to pile up new APIs (here a setting turned off by default) instead of extending old ones. I'm definitely not defending this, but some say that it is what saved Windows over all those years. – ybungalobill Jan 05 '22 at 18:32