엘카

echo off
echo *** STARTING DISK CLEANUP UTILITY***

C:

echo.
echo *** CLEANING FILES ***
if not exist c:\windows\temp goto NOTEMP
echo Cleaning Windows Temp...
cd c:\windows\temp
FOR %%A IN (*.*) DO DEL "%%A"
FOR /F "tokens=*" %%A IN ('DIR /B /AD') DO RMDIR /S /Q "%%A"
:NOTEMP

if not exist c:\WINDOWS\SoftwareDistribution\Download goto NODOWNLOAD
echo Cleaning Downloads...
cd c:\WINDOWS\SoftwareDistribution\Download
FOR %%A IN (*.*) DO DEL "%%A"
FOR /F "tokens=*" %%A IN ('DIR /B /AD') DO RMDIR /S /Q "%%A"
:NODOWNLOAD

if not exist C:\WINDOWS\ie8updates goto NOIE8
echo Cleaning IE8 Updates...
cd C:\WINDOWS\ie8updates
FOR %%A IN (*.*) DO DEL "%%A"
FOR /F "tokens=*" %%A IN ('DIR /B /AD') DO RMDIR /S /Q "%%A"
:NOIE8

if not exist C:\WINDOWS\ie7updates goto NOIE7
echo Cleaning IE7 Updates...
cd C:\WINDOWS\ie7updates
FOR %%A IN (*.*) DO DEL "%%A"
FOR /F "tokens=*" %%A IN ('DIR /B /AD') DO RMDIR /S /Q "%%A"
:NOIE7

echo.
echo *** DISK CLEANUP ***
REM note: prior to using this batch file, you should run cleanmgr /dc /sageset: 1
REM       which will allow you to set your default options for the sage:1 profile
REM       this should also empty your recycle bin (or you could use "rd /s c:\recycler")
cleanmgr /dc /sagerun: 1

echo.
echo *** DEFRAGGING DRIVES ***
echo DEFRAG C:
defrag c: -f

if not exist D: goto NODDRIVE
echo DEFRAG D:
defrag d: -f
:NODDRIVE

if not exist "C:\Program Files\VMware\VMware Tools" goto NOVMWARE
echo.
echo *** SHRINKING DRIVES ***
cd "C:\Program Files\VMware\VMware Tools\"
VMwareToolboxCmd.exe disk shrink c:\

if not exist D: goto NODDRIVESHRINK
VMwareToolboxCmd.exe disk shrink D:\
:NODDRIVESHRINK
:NOVMWARE


echo *** SHUTTING DOWN ***
shutdown -s -t 30