After the latest issue with CCleaner 5, and I know it has always corrupted my search index, I stopped using it and created my own batch file to clean the following folders:
C : \Windows\Temp
C : \Windows\Software Distribution\Download
C : \Users\&USERNAME&\Temp
I don't trust any utility any more to tinker with my system files or registry
Some problems to be wary of:
Event ID 80
CCleaner 5.01.0575 corrupted my SSD 01/01/2015
All my files are now corrupted...
sxs event id 78
Windows Event Viewer Error 78
======================================================
Temp Files Cleanup:
Cleans up the Temp folder in the C : \Windows\Temp
Cleans up the c : \users\yourusername\temp
Cleans up the Software Distribution folder where all the Windows updates are downloaded, but after they are installed, Windows doesn't delete them and they are no longer needed. Only run the file after you have rebooted if you installed Windows updates
To create the batch file, simply open a notepad, then paste the below text, then name it "
Temp Files Cleanup.bat"
DEL /S /F /Q "%temp%\*" 1>nul 2>nul
DEL /S /F /Q %systemroot%\temp\* 1>nul 2>nul
DEL /S /F /Q %systemroot%\SoftwareDistribution\Download\* 1>nul 2>nul
for /f %%i in ('"dir /s /b /ad "%temp%"" 2^>nul') do RD /S /Q %%i 1>nul 2>nul
for /f %%i in ('"dir /s /b /ad %windir%\temp" 2^>nul') do RD /S /Q %%i 1>nul 2>nul
for /f %%i in ('"dir /s /b /ad %windir%\SoftwareDistribution\Download" 2^>nul') do RD /S /Q %%i 1>nul 2>nul
===========================================
System Files Cleanup:
Cleans up all the above mentioned folder in addition to some extras like the system logs, .NET Framework temp files, etc.
To create the batch file, simply open a notepad, then paste the below text, then name it "
System Cleanup.bat"
@echo off
title .
color 1F
openfiles >nul 2>&1
if %errorlevel% NEQ 0 goto :UACPrompt
goto :gotAdmin
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~fs0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /b
:gotAdmin
DEL /S /F /Q "%temp%\*" 1>nul 2>nul
DEL /S /F /Q %systemroot%\temp\* 1>nul 2>nul
DEL /S /F /Q %systemroot%\inf\*.log 1>nul 2>nul
DEL /S /F /Q %systemroot%\Logs\CBS\* 1>nul 2>nul
DEL /S /F /Q %systemroot%\Logs\DPX\* 1>nul 2>nul
DEL /S /F /Q %systemroot%\Logs\DISM\* 1>nul 2>nul
DEL /S /F /Q %systemroot%\Microsoft.NET\Framework\v2.0.50727\*.log 1>nul 2>nul
DEL /S /F /Q %systemroot%\Microsoft.NET\Framework\v4.0.30319\*.log 1>nul 2>nul
if exist %systemroot%\SysWOW64\cmd.exe DEL /S /F /Q %systemroot%\Microsoft.NET\Framework64\v2.0.50727\*.log 1>nul 2>nul
if exist %systemroot%\SysWOW64\cmd.exe DEL /S /F /Q %systemroot%\Microsoft.NET\Framework64\v4.0.30319\*.log 1>nul 2>nul
DEL /S /F /Q %systemroot%\SoftwareDistribution\Download\* 1>nul 2>nul
RD /S /Q "%LocalAppData%\Microsoft\Windows\WER\ReportQueue" 1>nul 2>nul
for /f %%i in ('"dir /s /b /ad "%temp%"" 2^>nul') do RD /S /Q %%i 1>nul 2>nul
for /f %%i in ('"dir /s /b /ad %windir%\SoftwareDistribution\Download" 2^>nul') do RD /S /Q %%i 1>nul 2>nul
for /f %%i in ('"dir /s /b /ad %windir%\temp" 2^>nul') do RD /S /Q %%i 1>nul 2>nul
====================================
I've also uploaded the files if you wanna download them:
Temp Files Cleanup.bat
System Files Cleanup.bat