Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

@Echo off

cd\
c:
WMIC LOGICALDISK where drivetype=3 get caption,FreeSpace | find "C:"
(
echo ###############################################
echo %date% %time% Disk CleanUp Process Started
echo ###############################################
rd /s /q C:\Temp
md C:\Temp
del /s /q C:\ProgramData\Microsoft\Windows\WER\ReportArchive\*.*
del /s /q C:\ProgramData\Microsoft\Windows\WER\ReportQueue\*.*
del /s /q ITOPackage*.*
del /s /q psp-*.exe
del /s /q *.tmp
del /s /q *.bmc
net stop wuauserv
Takeown /f %windir%\winsxs\ManifestCache\*
Icacls %windir%\winsxs\ManifestCache\* /GRANT administrators:F
Del /q %windir%\winsxs\ManifestCache\*
Del C:\Windows\SoftwareDistribution\DataStore\DataStore.edb /q
del /s /q C:\Windows\SoftwareDistribution\Download\*.*
Del /s /q C:\Windows\SoftwareDistribution\ScanFile\*.*
net start wuauserv
forfiles /P "%SystemDrive%" /S /M *.dmp /D -32 /c "cmd /c DEL @FILE /Q"
for /d /r "c:\" %%a in (QRDeploy.vbe) do if exist "%%a" rmdir /s /q "%%~dpa"
for /d /r "c:\" %%a in (ITOPackage*) do if exist "%%a" rmdir /s /q "%%a"
rd /s /q %systemdrive%\$RECYCLE.BIN
echo #########################################
echo Empty Recycle Bin Windows 2003, 2000
echo #########################################
cd\
if exist "%SystemDrive%\Recycler" (
cd %SystemDrive%\Recycler
rd /q /s %SystemDrive%\Recycler
) else (echo Path "%SystemDrive%\Recycler" not exit)
echo.
echo ###############################################
echo %date% %time% Disk CleanUp Process Finished
echo ###############################################
)
WMIC LOGICALDISK where drivetype=3 get caption,FreeSpace,Size | find "C:"

You might also like