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


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.

| improve this answer | |
  • 30
    "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 5: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

Not the answer you're looking for? Browse other questions tagged or ask your own question.