The temp folder is not always deleted, even after proper shutdowns, and the space can pile up to large proportions. You don't need to delete the folder itself though, only its content. You can safely select everything, and shift-delete the files to permanently delete the files.

Understanding the Context

It will fail deleting everything and will complain that some files are in use. Just say Ignore for all occurrences ... My advice would be to create a new folder in the temp directory and move any files/folders you want to delete to the new folder, check if everything still works. I wanted to do disk cleanup myself and found a large folder in %localappdata% called Temp.

Key Insights

I wondered if deleting the contents of it won't harm my computer. All I know about "temp" folder... What are "temp" folders used for in Windows 10? - Super User The creators of Unix and most (all?) Linux distribution maintainers on the other hand see a strong relation between temporary files and automatic removal. So much so that they chose to delete them on every reboot.

Final Thoughts

I guess windows architects feel the same but abstain from deleting them because it is causing problems in some obscure 3rd party program. Sometimes compatibility is a PITA. It cannot delete the temp folders, especially in the windows folder because it is in use. you will want to delete all files in the folder and skip anything in use, instead of deleting the folder itself and recreating it. Since Windows 11 (or maybe earlier) Windows Notepad internally stores unsaved files so if the application (or Windows) crashes they will be still there later. For example, Notepad++ stores those temp When I open the temp folder by using Run and then %temp% it only shows around 40-50MB of files right after boot.

How can I remove these 20GB of invisible files? I only have a 240GB SSD so space is quite scarce. Here are a few photos: I run Windows 10 Home Activated. I have tried Disk Cleanup but this removed only around 30MB of files.