Skip to content

Instantly share code, notes, and snippets.

@dannymcc
Forked from illdecree/TuneUp.bat
Created December 26, 2012 15:50
Show Gist options
  • Save dannymcc/4381008 to your computer and use it in GitHub Desktop.
Save dannymcc/4381008 to your computer and use it in GitHub Desktop.
@ECHO OFF
REM This program is free software: you can redistribute it and/or modify
REM it under the terms of the GNU General Public License as published by
REM the Free Software Foundation, either version 3 of the License, or
REM (at your option) any later version.
REM
REM This program is distributed in the hope that it will be useful,
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
REM GNU General Public License for more details.
REM
REM You should have received a copy of the GNU General Public License
REM along with this program. If not, see <http://www.gnu.org/licenses/>.
TITLE Tune Up
msg %username% /time:0 Please ensure all work is saved and all other windows are closed before you continue!
del /f /q "%userprofile%\Start Menu\Programs\Accessories\Program Compatibility Wizard.lnk">nul
del /f /q "%userprofile%\Start Menu\Programs\Accessories\Tour Windows XP.lnk">nul
rd /s /q "C:\Documents and Settings\All Users\Start Menu\Programs\Games\">nul
del /f /q "%userprofile%\Start Menu\Programs\Outlook Express.lnk">nul
del /f /q "C:\Documents and Settings\All Users\Start Menu\Programs\MSN.lnk">nul
del /f /q "C:\Documents and Settings\All Users\Start Menu\Programs\Windows Messenger.lnk">nul
del /f /q "%userprofile%\Start Menu\Programs\Remote Assistance.lnk">nul
del /f /q "C:\Documents and Settings\All Users\Start Menu\Set Program Access and Defaults.lnk">nul
del /f /q "C:\Documents and Settings\All Users\Start Menu\Windows Catalog.lnk">nul
del /f /q "C:\Documents and Settings\All Users\Start Menu\New Microsoft Office Document*">nul
del /f /q "C:\Documents and Settings\All Users\Start Menu\Open Microsoft Office Document*">nul
CD /d "C:\Documents and Settings\All Users\Desktop">nul
del /f /q "Show Desktop*">nul
CD /d "%userprofile%\Desktop">nul
del /f /q "Show Desktop*">nul
:BEGIN
:MENU
COLOR 79
CLS
ECHO Hello %username%!
ECHO.
ECHO Please type the number for the option you want to perform.
ECHO All of these options will help your computer run faster.
ECHO Running all of these regularly will keep your computer running fast!
ECHO.
ECHO ***Please close all open applications before making a selection.***
ECHO -------------------------------------------------------------------
ECHO.
ECHO.
ECHO.
ECHO # Name Description
ECHO - ---- -----------
ECHO.
ECHO 1. Check Disk Checks hard drive for errors (requires a reboot)
ECHO 2. Disk Defragmenter Defragments hard drive
ECHO 3. Disk Cleanup Clean out unnecessary files
ECHO 4. Oilchange Clean out cookies and temp files
ECHO 5. McAfee Virus Scan Scan your computer for viruses (takes some time)
if exist "C:\PROGRA~1\CCleaner\" ECHO 6. CCleaner In depth cleaning. Cleans lots of temp files
ECHO.
ECHO 0. Deep Clean Run all options above
ECHO.
ECHO.
ECHO ----------------- ------------------
ECHO PRESS "Q" TO QUIT PRESS "H" FOR HELP
ECHO ----------------- ------------------
ECHO.
ECHO.
SET INPUT=
SET /P INPUT=Please select a number and press Enter:
IF /I '%INPUT%'=='1' GOTO Selection1
IF /I '%INPUT%'=='2' GOTO Selection2
IF /I '%INPUT%'=='3' GOTO Selection3
IF /I '%INPUT%'=='4' GOTO Selection4
IF /I '%INPUT%'=='5' GOTO Selection5
IF /I '%INPUT%'=='6' GOTO Selection6
IF /I '%INPUT%'=='0' GOTO Selection0
IF /I '%INPUT%'=='Q' GOTO EXIT
IF /I '%INPUT%'=='H' GOTO HELP
IF /I '%INPUT%'=='VIEWSOURCE' GOTO VIEWSOURCE
CLS
COLOR 4F
ECHO.
ECHO Oh snap!
ECHO ========
ECHO.
ECHO.
ECHO You've entered an invalid option!
ECHO.
ECHO Press any key and we'll try this again...
PAUSE > NUL
GOTO MENU
:Selection1
cls
ECHO Scheduling Check Disk...
ECHO.
ECHO.
chkdsk /r
:CDchoice
set /P c=Reboot now to begin Check Disk? [Y/N]
if /I "%c%" EQU "Y" goto :CDREBOOT
if /I "%c%" EQU "N" goto :CDQUIT
goto :CDchoice
GOTO Quit
:CDREBOOT
taskkill /IM explorer.exe /F
shutdown -r -t 0
cls
ECHO Rebooting now!
:Selection2
cls
ECHO Now Defragmenting... (this will take some time)
ECHO.
ECHO.
defrag C: -f
defrag D: -f
GOTO Quit
:Selection3
cls
ECHO Now running Disk Cleanup...
c:\windows\system32\cleanmgr.exe /dc /sagerum: 1
GOTO Quit
:Selection4
cls
del /a /s /q %windir%\temp & md %windir%\temp>nul
del /a /s /q %userprofile%\recent\*.*>nul
del /a /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*">nul
del /a /s /q "%userprofile%\Local Settings\Temp\*.*">nul
del /a /s /q "%userprofile%\recent\*.*">nul
del /a /s /q %systemdrive%\*.tmp>nul
del /a /s /q %systemdrive%\*._mp>nul
del /a /s /q %systemdrive%\*.log>nul
del /a /s /q %systemdrive%\*.gid>nul
del /a /s /q %systemdrive%\*.chk>nul
del /a /s /q %systemdrive%\*.old>nul
del /a /s /q %systemdrive%\recycled\*.*>nul
del /a /s /q %windir%\*.bak>nul
del /a /s /q %windir%\prefetch\*.*>nul
GOTO Quit
:Selection5
cls
ECHO Now scanning for viruses...
ECHO This will take a while.
CD "C:\Program Files\McAfee\VirusScan Enterprise\
scan32.exe /ALL
GOTO Quit
:Selection6
cls
ECHO CCleaner now running...
C:\PROGRA~1\CCleaner\CCleaner.exe /AUTO
GOTO Quit
:Selection0
taskkill /IM explorer.exe /F
cls
ECHO.
ECHO.
ECHO Starting Deep Clean...
ECHO.
chkdsk /r
c:\windows\system32\cleanmgr.exe /dc /sagerum: 1
ECHO CCleaner now running...
if exist "C:\PROGRA~1\CCleaner\" C:\PROGRA~1\CCleaner\CCleaner.exe /AUTO
cls
del /a /s /q %windir%\temp & md %windir%\temp>nul
del /a /s /q %userprofile%\recent\*.*>nul
del /a /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*">nul
del /a /s /q "%userprofile%\Local Settings\Temp\*.*">nul
del /a /s /q "%userprofile%\recent\*.*">nul
del /a /s /q %systemdrive%\*.tmp>nul
del /a /s /q %systemdrive%\*._mp>nul
del /a /s /q %systemdrive%\*.log>nul
del /a /s /q %systemdrive%\*.gid>nul
del /a /s /q %systemdrive%\*.chk>nul
del /a /s /q %systemdrive%\*.old>nul
del /a /s /q %systemdrive%\recycled\*.*>nul
del /a /s /q %windir%\*.bak>nul
del /a /s /q %windir%\prefetch\*.*>nul
cls
ECHO Defragmenting hard drive...
defrag C: -f
defrag D: -f
cls
ECHO Scanning for viruses...
CD "C:\Program Files\McAfee\VirusScan Enterprise\
scan32.exe /ALL
cls
ECHO Rebooting now. Check Disk will begin after reboot...
shutdown -r -f -t 0
PAUSE>nul
:HELP
cls
ECHO.
ECHO For support, please call the support desk at (***) ***-****
ECHO.
Pause
GOTO BEGIN
:Quit
:choice
cls
ECHO.
ECHO.
ECHO.
ECHO.
IF /I '%INPUT%'=='1' ECHO Check Disk will begin after next reboot!
IF /I '%INPUT%'=='2' ECHO Defragmenting complete!
IF /I '%INPUT%'=='3' ECHO Disk Cleanup has finished cleaning!
IF /I '%INPUT%'=='4' ECHO Oilchange complete!
IF /I '%INPUT%'=='5' ECHO Virus scan complete!
IF /I '%INPUT%'=='6' ECHO CCleaner finished cleaning your hard drive!
IF /I '%INPUT%'=='0' ECHO Deep Clean Finished!
ECHO.
ECHO.
ECHO.
:CDQUIT
set /P c=Would you like to perform another task? [Y/N]
if /I "%c%" EQU "Y" goto :begin
if /I "%c%" EQU "N" goto :EXIT
goto :choice
:EXIT
cls
COLOR F2
ECHO Thank You!
ECHO -------------------------------------
ECHO Press any key to exit...
PAUSE>NUL
EXIT
:VIEWSOURCE
START Notepad %0\..\*.bat
GOTO BEGIN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment