Where are "temporary files" cleaned by Windows 7 Disk Cleanup?

11

3

My disk cleanup seems unable to delete a lot of messages worth of "temporary files" that it sees, even after I went and deleted contents of various temporary folders I found myself. I would like to try delete such files manually, but for this I need to figure out just where are those "temporary files" that Disk Cleanup is detecting and offering to delete.

Any suggestions? What folders does Disk Cleanup examine to tally up the temporary files?

EndangeringSpecies

Posted 2012-12-01T19:46:00.940

Reputation: 593

1In my case, I want to know because it's saying i have 5 GB of temp files and I want to know what they are before they are deleted. – Dan Pritts – 2015-12-25T04:54:03.927

Why do you want to delete temporary files manually ? Are you saying that you have so much temporary files that disk cleanup cannot cope and leaves a certain volume behind ? – Simon – 2012-12-01T22:07:44.260

Answers

8

The "Temporary Files" folder that Disk Cleanup is referring to is the one pointed to by the environment variable %TEMP%. You can go directly to this folder by typing %TEMP% in the Run box or in the address bar in Windows Explorer.

Disk Cleanup's list of "places to cleanup" is stored in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches. The Temporary Files item is in a key named, unsurprisingly, Temporary Files.

Patrick Seymour

Posted 2012-12-01T19:46:00.940

Reputation: 7 662

The TEMP and TMP environment variables point to the current user's temp file directory only. – kreemoweet – 2014-06-28T17:47:26.453

1There are system environment variables for TEMP and TMP also. A program can ask for the system variables instead of the user variables. – Patrick Seymour – 2014-06-30T00:24:01.923

1

In my Windows 7, the system TEMP is C:\Windows\Temp but that also doesn't contain 408 GB of my 1 TB HDD.

– Cees Timmerman – 2016-03-28T11:35:31.807

2

I couldn't find anything other than %TEMP% in the registry key mentioned by Patrick, so I tried to log cleanmgr.exe using Process Monitor.

cleanmgr.exe does a File System Class SetDispositionInformationFile Operation with Delete: True Detail on files in %TEMP%, which in my case according to echo is equal to %LOCALAPPDATA%\Temp

It had already deleted the 3 GB unaccounted for by %TEMP% though, and didn't trim the 500+ MB C:\Windows\Logs\CBS\CBS.log; I suspect most of my wasted space was in winsxs.

Cees Timmerman

Posted 2012-12-01T19:46:00.940

Reputation: 1 240

-2

It's very simple to remove all temporary files on Windows 7 64bit or 32-bit. Just do the below:

  1. Open (RUN), type %temp%, and then Enter.
  2. You will find that all temporary files are in that folder. Just remove what you want.

See http://www.get-answer.net/questions/how-to-remove-the-temp-files-in-windows-7-64x/.

Ahmed Alaa

Posted 2012-12-01T19:46:00.940

Reputation: 1

1Welcome to Super User! This duplicates another answer and adds no new content. Please don't post an answer unless you actually have something new to contribute. – DavidPostill – 2016-08-07T07:05:32.590

1

It is also an exact copy of the text in the link without the required quote format. Please read How to reference material written by others. You should block quote text that has been written by some else. See Markdown help.

– DavidPostill – 2016-08-07T07:06:53.067

1The link is broken. – Peter Mortensen – 2017-03-25T22:01:29.900