Im not exactly sure what it constitutes as Temporary files, but theres a few places you should check.
%temp%
typically points to %systemdrive%\Windows\Temp
- which is the default system wide temporary folder. However, its good security practise for each user to have their own temp folder which are located %systemdrive%\users\{USERNAME}\AppData\Local\Temp
(replacing "{USERNAME}" for each folder in the users folder). Also, checkout the recycle bin - anything lurking in there?
In general as @Ramhound mentioned its well worth inspecting your whole disk visually to really see whats going on, don't rely on the wizard.
Below is a screen shot from TreeSize free, which provides a graphical tree view of your drive and the background graph shows where your space is being used in each folder.
Obviously be careful with this approach, you could damage an application or windows component by deleting its files. But with a little common sense and some research you can make good space savings and uncover wastage you would probably not otherwise notice and claw back some precious storage.
General space saving tips
Uninstall stuff & clean up old uninstallations
Windows is much better at cleaning up after itself these days, but applications will often create temporary files, documents, media files, save games etc. Check Desktop, My Documents and Music, Pictures etc - remove any junk, default files. Also, when you uninstall a program often the installer will only delete the files it installed - so you end up with logs and crash dumps and other junk left behind even after properly removing software.
WinSxS
WARNING!! DO NOT touch/modify/delete inside C:\Windows\WinSxS
- use below DISM commands only - its a critical system folder.
WinSxS is a system folder may sometimes bloat (leftovers from patches or uninstalls), you can run:
Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore
If it recommends cleanup, run:
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
NOTE - running the above command will save some space, but prevent removal of any currently installed updates.
System Restore
May be worth checking your System restore settings by default it will reserve a percentage of your disk. I dont recommend disabling it entirely, but it can make sense to restrict its size if your space limited at the cost of having fewer restore points to roll back to in the event of an issue.
Edit Following Comment
I think theres probably lots of reasons for some drift, exactly what depends on your system. Without seeing whats using the space in your Windows folder i can only guess, but below are some of the usual suspects/fixes.
c:\Windows\SoftwareDistribution\Download\
Windows updates stores files here. In theory it should clean up this directory but you might have old updates that failed or became stuck for whatever reason. You can delete files from here, some of the files will return. You will probably need to use safe mode or stop both the Windows Update and BITS services to delete these files.
C:\Windows\Installer
This folder is required, but is not often used. You can safely enable compression of this folder to save a little space. (Enabling compression saves space, but requires more CPU time - i would only enable this on folders that are used infrequently).
Windows Apps
There are a load of default optional components installed that dont appear in the add remove control panel. You need to launch a Powershell window as Administrator. Run this command to list the installed packages:
Get-AppxPackage -AllUsers | select -Property Name
Then use the following command to uninstall the package (Bing News in this case taken from the previous commands output.
Get-AppxPackage -AllUsers | where {$_.Name -like "Microsoft.BingNews" } | Remove-AppxPackage -AllUsers
The above commands uninstalls the packages, the next set of commands removes the installation packages entirely (and c:\Windows\InfusedApps will get smaller - dont edit this folder directly). Same process, list the available packages, then remove them as required. You need to have uninstalled the package before you remove it, and some packages are not removable (without ugly/unsupported hacks at least)
Get-AppxProvisionedPackage -Online | select DisplayName
To remove the xbox related packages use Microsoft.Xbox*
Get-AppxProvisionedPackage -Online | where {$_.DisplayName -like "Microsoft.Xbox*" } | Remove-AppxProvisionedPackage -Online
Use a tool to visualize your system usage, and provide that information as an edit to your question, how you delete the temporary files depends on where it is located.
– Ramhound – 2019-01-30T19:43:50.0333There are more locations where Temp files are stored besides your %temp% folder. Many more. Disk Cleanup will do a more thorough cleaning of your various temp locations. – music2myear – 2019-01-30T19:54:08.537
Possible duplicate of How can I visualize the file system usage on Windows?. Since this question was encouraging answers that solutions to visualize disk usage, I went ahead, and flagged it as a duplicate for the apprpriate canonical question on the subject
– Ramhound – 2019-01-31T00:21:37.847@Mihkel - Your disk space isn't be used by temporary files. It is being used by Program Files and Windows. The Settings application is likely counting temporary files created by Windows (required update files necessary to remove updates, that sort of thing). – Ramhound – 2019-01-31T19:31:14.160
There are some Windows 10 bugs that fill up Temp folders with error reports, e.g., https://answers.microsoft.com/en-us/protect/forum/all/help-pc-is-creating-temporary-files-every-second/afc8ed23-2ae9-4d8a-95db-995d578f89c5
– Fuhrmanator – 2019-11-08T16:39:08.690What about the mystery posed in the OP's first couple sentences: Why don't the breakdowns in Settings->Storage add up to the totals? My computers have similar discrepancies - the storage number for "Temporary Files" is way more than the total of the breakdown shown when one clicks on it. It should at least admit something like, "There are also 19.5GB of Temporary Files besides these." – OsakaWebbie – 2019-12-23T01:30:39.733