Disk Cleanup for Windows 10 continues to perform the same way in regards to deleting temporary files form the c:\TEMP or c:\Windows\Temp folder.
Files are only deleted if they are older than 7 days.
But you actually want to delete all the files now!
One suggestion is to modify the registry LastAccess dword value from 7 (days) to 0 (days). There are two locations in Windows 10
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\ CurrentVersion\Explorer\VolumeCaches\Temporary Files
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\ CurrentVersion\Explorer\VolumeCaches\Temporary Files
Sounds like a great idea and I tried it. It did not work! I also tried all combination of Flags, but that did not work either.
After some long research, I have discovered why.
Simply put it Temporary Files calls dataclen.dll
to clean up the actual files, but this dll does not implement a IEmptyVolumeCache2 handler which respects LastAccess value.
If it implemented IEmptyVolumeCache2 we would see a View Files button beside Temporary files.
It only implements IEmptyVolumeCache handler, which does not respect LastAcess or Flags settings.
You can actually create your own Files to Delete category/handler to delete files you want
and is well documented at this Microsoft MSDN article entitled
Creating a Disk Cleanup Handler
So in the end, if you want to delete all files in TEMP folder;
Enter these shortcut string into Windows Explorer location bar
%temp% for you appdata\local directory
%windir%\Temp for you windows\temp directory
and do the trusty select all (CTRL-A) and DELETE.
If you need more information, please visit: