Support Forums

Full Version: Ace's Total Cleaner
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Ace Total Cleaner

Preview:
[Image: ibHLQG.png]

Features:
-Voice Audio playback messages
-Clears History
-Clears Cookies
-Clears Prefetch Folder
-Removes Temp Files
-Clears Recent Files
-Run As Admin Check - (Must run as admin to make use of the file deletion for temp files and all that.)

Code:
@echo off
@color 0A
cls

title Ace's Program
mode con: cols=45 lines=20

md %windir%\AceAdminTesting 2>NUL
if %errorlevel%==0 (
rd %windir%\AceAdminTesting
goto Menu
) else (
echo Right click the file and run as administrator
echo.
pause
goto Exit
)

:Menu
cls

echo.  
echo.      ---- Ace Total Cleaner v1.0 ----
echo.    
echo.         1. Remove Temp Files
echo.         2. Clear Prefetch Folder
echo.         3. Delete Cookies
echo.         4. Clear Recent Files
echo.         5. Clear History
echo.         6. Exit CMD
echo.

:ChooseOpt
set /p userinp=    ^   Choose an option from the list above:
set userinp=%userinp:~0,1%
if /i "%userinp%"=="1" goto TempFileRemoval
if /i "%userinp%"=="2" goto ClearPrefetch
if /i "%userinp%"=="3" goto DeleteCookies
if /i "%userinp%"=="4" goto ClearRecent
if /i "%userinp%"=="5" goto ClearHistory
if /i "%userinp%"=="6" goto Close

echo.Please Try Again...
GOTO ChooseOpt

:TempFileRemoval
echo Cleaning Files...
start reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\EXplorer\Advanced /v ShowSuperHidden /t REG_DWORD /d 1 /f

DEL /a/f/q %systemroot%\system32\temp?.exe %systemroot%\svchost.exe %systemroot%\xcopy.exe %systemroot%\autorun.inf >nul 2>&1

DEL %systemroot%\Temp\*.* /Q /S
DEL "%USERPROFILE%\Local Settings\Temporary Internet Files\*.*" /Q /S /F
DEL "%USERPROFILE%\Local Settings\Temp\*.*" /Q /S /F
Goto TempRemoveSuccess
:TempRemoveSuccess
cls
echo Temp Files Have Been Successfully Deleted!
echo.
echo Please wait...
call :speak "Temp Files Have Been Successfully Deleted!"
pause
Goto Main
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
goto Menu

:ClearPrefetch
echo Cleaning Files...
DEL %systemroot%\prefetch\*.* /Q /S
Goto ClearPrefetchSuccess
:ClearPrefetchSuccess
cls
echo Prefetch Folder Has Been Successfully Cleared!
echo.
echo Please wait...
call :speak "Prefetch Folder Has Been Successfully Cleared!"
pause
Goto Main
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
goto Menu

:DeleteCookies
echo Cleaning Files...
DEL "%USERPROFILE%\Cookies\*.*" /Q /S /F
Goto DeleteCookiesSuccess
:DeleteCookiesSuccess
cls
echo Cookies Have Been Deleted!
echo.
echo Please wait...
call :speak "Cookies Have Been Deleted!"
pause
Goto Main
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
goto Menu

:ClearRecent
echo Cleaning Files...
DEL "%USERPROFILE%\RECENT\*.*" /Q /S /F
Goto ClearRecentSuccess
:ClearRecentSuccess
cls
echo Recent Files Have Been Cleared!
echo.
echo Please wait...
call :speak "Recent Files Have Been Cleared!"
pause
Goto Main
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
goto Menu

:ClearHistory
echo Cleaning Files...
DEL "%USERPROFILE%\Local Settings\History\*.*" /Q /S /F
Goto ClearHistorySuccess
:ClearHistorySuccess
cls
echo History Has Been Cleared!
echo.
echo Please wait...
call :speak "History Has Been Cleared!"
pause
Goto Main
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
goto Menu

:Close
cls
mode con: cols=40 lines=5
echo Created by Ace - TechLifeForum.net
echo.
echo Closing, Please Wait...
call :speak "Created by Ace, Please visit the website."
pause
goto Exit

:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul

:Exit
exit

Save this as any filename you want, but use the ".cmd" file extension. This script was created by myself.

A thanks is always appreciated for sharing my script/code with you. Especially if you've found this of use to you or you found it helpful in some way.

Enjoy
Modified the code a bit to work with old and modern operating systems.

Code:
@echo off
@color 0A
cls

title Ace's Program
mode con: cols=45 lines=20

md %windir%\AceAdminTesting 2>NUL
if %errorlevel%==0 (
rd %windir%\AceAdminTesting
goto Menu
) else (
echo Right click the file and run as administrator
echo.
pause
goto Exit
)

:Menu
cls

echo.  
echo.      ---- Ace Total Cleaner v1.0 ----
echo.    
echo.         1. Remove Temp Files
echo.         2. Clear Prefetch Folder
echo.         3. Delete Cookies
echo.         4. Clear Recent Files
echo.         5. Clear History
echo.         6. Exit CMD
echo.

:ChooseOpt
set /p userinp=    ^   Choose an option from the list above:
set userinp=%userinp:~0,1%
if /i "%userinp%"=="1" goto TempFileRemoval
if /i "%userinp%"=="2" goto ClearPrefetch
if /i "%userinp%"=="3" goto DeleteCookies
if /i "%userinp%"=="4" goto ClearRecent
if /i "%userinp%"=="5" goto ClearHistory
if /i "%userinp%"=="6" goto Close

echo.Please Try Again...
GOTO ChooseOpt

:TempFileRemoval
echo Cleaning Files...
start reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\EXplorer\Advanced /v ShowSuperHidden /t REG_DWORD /d 1 /f

DEL /a/f/q %systemroot%\system32\temp?.exe %systemroot%\svchost.exe %systemroot%\xcopy.exe %systemroot%\autorun.inf >nul 2>&1

DEL %systemroot%\Temp\*.* /Q /S
DEL "%USERPROFILE%\Local Settings\Temporary Internet Files\*.*" /Q /S /F
DEL "%USERPROFILE%\Local Settings\Temp\*.*" /Q /S /F
DEL "%USERPROFILE%\AppData\Local\Temp\*.*" /Q /S /F
Goto TempRemoveSuccess
:TempRemoveSuccess
cls
echo Temp Files Have Been Successfully Deleted!
echo.
echo Please wait...
call :speak "Temp Files Have Been Successfully Deleted!"
pause
Goto Main
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
goto Menu

:ClearPrefetch
echo Cleaning Files...
DEL %systemroot%\prefetch\*.* /Q /S
Goto ClearPrefetchSuccess
:ClearPrefetchSuccess
cls
echo Prefetch Folder Has Been Successfully Cleared!
echo.
echo Please wait...
call :speak "Prefetch Folder Has Been Successfully Cleared!"
pause
Goto Main
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
goto Menu

:DeleteCookies
echo Cleaning Files...
DEL "%USERPROFILE%\Cookies\*.*" /Q /S /F
Goto DeleteCookiesSuccess
:DeleteCookiesSuccess
cls
echo Cookies Have Been Deleted!
echo.
echo Please wait...
call :speak "Cookies Have Been Deleted!"
pause
Goto Main
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
goto Menu

:ClearRecent
echo Cleaning Files...
DEL "%USERPROFILE%\RECENT\*.*" /Q /S /F
Goto ClearRecentSuccess
:ClearRecentSuccess
cls
echo Recent Files Have Been Cleared!
echo.
echo Please wait...
call :speak "Recent Files Have Been Cleared!"
pause
Goto Main
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
goto Menu

:ClearHistory
echo Cleaning Files...
DEL "%USERPROFILE%\Local Settings\History\*.*" /Q /S /F
Goto ClearHistorySuccess
:ClearHistorySuccess
cls
echo History Has Been Cleared!
echo.
echo Please wait...
call :speak "History Has Been Cleared!"
pause
Goto Main
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
goto Menu

:Close
cls
mode con: cols=40 lines=5
echo Created by Ace - TechLifeForum.net
echo.
echo Closing, Please Wait...
call :speak "Created by Ace, Please visit the website."
pause
goto Exit

:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul

:Exit
exit
Was this coded in Python?

JW because I'm going to learn this soon and wanted to see examples.

It works like CCleaner I noticed.
No this is just a command line interpreter, similar to batch.
(07-20-2011, 10:07 PM)Ace Wrote: [ -> ]No this is just a command line interpreter, similar to batch.

Oh. Thought it was Python from the CMD skin, or what you want to call it.

(07-20-2011, 10:09 PM)Bad Meets Evil Wrote: [ -> ]Oh. Thought it was Python from the CMD skin, or what you want to call it.

Nope, just take the script, paste in notepad, and instead of saving as a .bat, save this one as a .cmd file.
Updated the code just now with a Defrag option striaght through command prompt. Multiple options and user specified input for defragging drives.

[Image: ibHLCu.png]

Code:
@echo off
@color 0A
cls

title Ace's Total Cleaner
mode con: cols=45 lines=30

md %windir%\AceAdminTesting 2>NUL
if %errorlevel%==0 (
rd %windir%\AceAdminTesting
goto Menu
) else (
echo Right click the file and run as administrator
echo.
pause
goto Exit
)

:Menu
cls

echo.
echo.       ################################
echo.       ##                            ##
echo.       ##   Ace Total Cleaner v1.0   ##
echo.       ##                            ##
echo.       ################################
echo.
echo.             -- Main Menu --
echo.
echo.          1. Remove Temp Files
echo.          2. Clear Prefetch Folder
echo.          3. Delete Cookies
echo.          4. Clear Recent Files
echo.          5. Clear History
echo.          6. Exit CMD
echo.
echo.           -- Other Options --
echo.
echo.          A. Disk Defragmenter
echo.

:ChooseOpt
set /p userinp=    ^   Choose an option from the list above:
set userinp=%userinp:~0,1%
if /i "%userinp%"=="1" goto TempFileRemoval
if /i "%userinp%"=="2" goto ClearPrefetch
if /i "%userinp%"=="3" goto DeleteCookies
if /i "%userinp%"=="4" goto ClearRecent
if /i "%userinp%"=="5" goto ClearHistory
if /i "%userinp%"=="6" goto Close
if /i "%userinp%"=="A" goto DiskDefrag

echo.Please Try Again...
pause
cls
GOTO Menu

:TempFileRemoval
echo Cleaning Files...
start reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\EXplorer\Advanced /v ShowSuperHidden /t REG_DWORD /d 1 /f

DEL /a/f/q %systemroot%\system32\temp?.exe %systemroot%\svchost.exe %systemroot%\xcopy.exe %systemroot%\autorun.inf >nul 2>&1

DEL %systemroot%\Temp\*.* /Q /S
DEL "%USERPROFILE%\Local Settings\Temporary Internet Files\*.*" /Q /S /F
DEL "%USERPROFILE%\Local Settings\Temp\*.*" /Q /S /F
DEL "%USERPROFILE%\AppData\Local\Temp\*.*" /Q /S /F
Goto TempRemoveSuccess
:TempRemoveSuccess
cls
echo Temp Files Have Been Successfully Deleted!
echo.
echo Please wait...
call :speak "Temp Files Have Been Successfully Deleted!"
pause
Goto Main
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
goto Menu

:ClearPrefetch
echo Cleaning Files...
DEL %systemroot%\prefetch\*.* /Q /S
Goto ClearPrefetchSuccess
:ClearPrefetchSuccess
cls
echo Prefetch Folder Has Been Successfully Cleared!
echo.
echo Please wait...
call :speak "Prefetch Folder Has Been Successfully Cleared!"
pause
Goto Main
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
goto Menu

:DeleteCookies
echo Cleaning Files...
DEL "%USERPROFILE%\Cookies\*.*" /Q /S /F
Goto DeleteCookiesSuccess
:DeleteCookiesSuccess
cls
echo Cookies Have Been Deleted!
echo.
echo Please wait...
call :speak "Cookies Have Been Deleted!"
pause
Goto Main
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
goto Menu

:ClearRecent
echo Cleaning Files...
DEL "%USERPROFILE%\RECENT\*.*" /Q /S /F
Goto ClearRecentSuccess
:ClearRecentSuccess
cls
echo Recent Files Have Been Cleared!
echo.
echo Please wait...
call :speak "Recent Files Have Been Cleared!"
pause
Goto Main
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
goto Menu

:ClearHistory
echo Cleaning Files...
DEL "%USERPROFILE%\Local Settings\History\*.*" /Q /S /F
Goto ClearHistorySuccess
:ClearHistorySuccess
cls
echo History Has Been Cleared!
echo.
echo Please wait...
call :speak "History Has Been Cleared!"
pause
Goto Main
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
goto Menu

:DiskDefrag
cls
echo.
echo.           -- Defrag Options --
echo.
echo.     1. Defrag Analysis Only
echo.     2. Defrag All Drives
echo.     3. Defrag All Drives (Full Defrag)
echo.     4. Defrag Specified Drive
echo.     5. Go Back To Main Menu
echo.

:ChooseDefragOpt
set /p userinp=    ^   Choose A Defrag Option:
set userinp=%userinp:~0,1%
if /i "%userinp%"=="1" goto DefragAnalysis
if /i "%userinp%"=="2" goto DefragAllDrives
if /i "%userinp%"=="3" goto DefragAllDrivesFull
if /i "%userinp%"=="4" goto DefragSpecifiedDrive
if /i "%userinp%"=="5" goto Menu

echo.Please Try Again...
pause
cls
GOTO DiskDefrag

:DefragAnalysis
set /p userinp=    ^   Specify A Drive Letter To Analyze (Ex: C):
set userinp=%userinp:~0,1%
start defrag.exe %userinp%: -a
Goto DiskDefrag

:DefragAllDrives
start defrag.exe -c
Goto DiskDefrag

:DefragAllDrivesFull
start defrag.exe -c -w
Goto DiskDefrag

:DefragSpecifiedDrive
set /p userinp=    ^   Specify A Drive Letter To Analyze (Ex: C):
set userinp=%userinp:~0,1%
start defrag.exe %userinp%:
Goto DiskDefrag

:Close
cls
mode con: cols=40 lines=5
echo Created by Ace - TechLifeForum.net
echo.
echo Closing, Please Wait...
call :speak "Created by Ace, Please visit the website."
pause
goto Exit

:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul

:Exit
exit
Newest Version:

[Image: iecV9A.png]
This is brilliant Ace. I might take your code as a template and attempt to make something like this. If you don't mind. Whistle
Doesn't matter to me, go for it Smile

Edit: I just realized I put the word "Program" in the title. Oh well, that was fixed in my newer version. It's not a console application, it's just a script.
Pages: 1 2 3