
@echo off

:: BatchGotAdmin
:-------------------------------------

>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"


if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    set params = %*:"=""
    echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs"
    exit /B

:gotAdmin
    pushd "%CD%"
    CD /D "%~dp0"
:--------------------------------------


@echo off

:mainmenu 
title Cleanup Tools
cls 
color 0a




echo ********************** 
echo *    CleanUp Menu    *
echo ********************** 
echo * 1. Temp CleanUp    * 
echo * 2. Disk CleanUp    * 
echo * 3. Disk Defragment * 
echo * 4. Quit            * 
echo ********************** 
choice /C:1234 >nul

if %errorlevel% equ 1 goto start 
if %errorlevel% equ 2 goto cleanmgr 
if %errorlevel% equ 3 goto defrag 
if %errorlevel% equ 4 goto quit

REM closes the program
:quit 
exit /b

:start


@echo off

echo Cleaning system junk files, please wait…


del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q “%userprofile%\Local Settings\Temporary Internet Files\*.*”
del /f /s /q “%userprofile%\Local Settings\Temp\*.*”
del /f /s /q “%userprofile%\recent\*.*”



echo Cleaning of junk files is finished!


echo. & pause


pause 
goto mainmenu 


:cleanmgr

@echo off
c:\windows\system32\cleanmgr.exe /lowdisk

pause
goto mainmenu

:defrag

@echo off
defrag.exe c: -v

pause
goto mainmenu