You are on page 1of 1

Deleting Windows Temporary files

C:\> dir *.tmp /s >> “C:\users\driftikar\downloads\filename.txt”

==============================================================
For the last several years I have run occasionally, perhaps weekly, a BATch file which
contains
DEL C:\*.TMP /S
to delete all .TMP files from the system drive.
That is, all .TMP files except those which are currently in use, each of which gives an
"Access is denied." message.

It also deletes .TMPLX and .TMPLL files from a couple of truly obscure WinSXS
directories, but these seem happily to be recreated by <whatever> process.

Be very careful to get the DEL line absolutely correct, otherwise Unhappiness Could Occur...

==================================================================

net stop wuauserv


del c:\windows\SoftwareDistribution /q /s
net start wuauserv

I am not aware of a 'best practice' way of reducing the size of the folder, but I have used
methods similar to the one above. However, I do not recommend having it as a computer
startup script. *Possibly* as a scheduled task that runs every quarter or bi-annually.
==================================================================
The %windir%\SoftwareDistribution\Download folder is automatically maintained by the
WUAgent. On the off-chance that the Datastore and the Download folder get de-
synchronized, it may be necessary one-time-only to delete any content in the Download
folder that is over 10 days old.
Any continued issues is evidence of a more serious client health issue.
In addition, the Datastore contains all of the Windows Update History for the client system.
Destroying the SoftwareDistribution folder, except when expressly warranted due to error
conditions for which destruction of the SoftwareDistribution folder is the only solution,
destroys the entire Windows Update History for that client system.
It also results in longer detection times at the next detection, because the WUAgent has to re-
cache howeverMany thousands of available updates, as result of the destruction of the
Datastore.
=================================================================

You might also like