|
|
![]() |
|
|
Top | #1 |
|
OSNN Senior Addict
Joined: February 2003
Posts: 932
Reputation: 300
Power: 126 |
Download Regcleaner Download Spybot If the installation path of Spybot or Regcleaner is other than 'C:\Program Files' you'll need to specify otherwise in the file. Also if you have other drives besides C:, D:, E:, F:, G:, H: that need to be defragmented you'll need to specify otherwise in the file as well. If you don't want to use my EXE file you must run config.bat to use the Windows Cleanmgr. The source is as follows: OLD, new version below Code:
@echo off echo Performing Spybot Operations...Please Wait C:\Progra~1\Spybot~1\SpybotSD.exe /autoupdate /autoimmunize /autocheck /autofix /autoclose cls echo Cleaning Disk...Please Wait cleanmgr /sagerun:n del %TEMP%\*.* /q del %TMP%\*.* /q del %userprofile%\LOCALS~1\Tempor~1\*.* /q del %userprofile%\LOCALS~1\History\*.* /q del %SYSTEMROOT%\prefetch\*.* /q cls echo Cleaning Registry...Please Wait C:\Progra~1\RegCleaner\RegCleanr.exe /Automatic Cleanup Mode cls echo ----------------- echo Defragmenting C:\ echo ----------------- defrag C: cls echo ----------------- echo Defragmenting E:\ echo ----------------- defrag E: cls echo ----------------- echo Defragmenting F:\ echo ----------------- defrag F: cls echo ----------------- echo Defragmenting G:\ echo ----------------- defrag G: cls echo ----------------- echo Defragmenting H:\ echo ----------------- defrag H: cls echo All Processes Complete pause * Cleanmgr.exe sometimes hangs, to continue with the cleaning process just end its task in the task manager |
|
|
|
|
|
Top | #2 |
|
OSNN Senior Addict
Joined: February 2003
Posts: 932
Reputation: 300
Power: 126 |
Major update: added logic controls to the entire script.
It will let you know what is running and what was sucessfully ended. Code:
@echo off :: ENVIRONMENT VARIABLES set cleanmg=Disk Cleanup...Pending set tempo= Delete files in %TEMP%...Pending set tmpo= Delete files in %TMP%...Pending set historyo= Clear History...Pending set prfetch= Clear Prefetch...Pending set regcl=Clean the registry...Pending echo Please specify Disk Cleanup Options cleanmgr /sageset:n call cls :: BEGIN SPYBOT set spybot=Performing Spybot Operations...Please Wait echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- echo %spybot% echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- echo %cleanmg% echo %tempo% echo %tmpo% echo %historyo% echo %prfetch% echo %regcl% echo Defragment all available drives...Pending C:\Progra~1\Spybot~1\SpybotSD.exe /autoupdate /autoimmunize /autocheck /autofix /autoclose if not errorlevel 1 goto success set spybot=Performing Spybot Operations...Failed goto next :success set spybot=Performing Spybot Operations...Successful :next cls echo %spybot% :: BEGIN CLEANMGR set cleanmg=Cleaning Disk...Please Wait echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- echo %cleanmg% echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- echo %tempo% echo %tmpo% echo %historyo% echo %prfetch% echo %regcl% echo Defragment all available drives...Pending cleanmgr /sagerun:n if not errorlevel 1 goto success set cleanmg=Cleaning Disk...Not all operations completed goto next :success set cleanmg=Cleaning Disk...Successfull :next del %TEMP%\*.* /q set tempo= Delete files in %TEMP%...Success if not errorlevel 1 goto next set tempo= Delete files in %TEMP%...Failed :next del %TMP%\*.* /q set tmpo= Delete files in %TMP%...Success if not errorlevel 1 goto next set tmpo= Delete files in %TMP%...Failed :next del %userprofile%\LOCALS~1\History\*.* /q set historyo= Clear History...Success if not errorlevel 1 goto next set historyo= Clear History...Failed :next del %SYSTEMROOT%\prefetch\*.* /q set prfetch= Clear Prefetch...Success if not errorlevel 1 goto next set prfetch= Clear Prefetch...Failed :next cls echo %spybot% echo %cleanmg% echo %tempo% echo %tmpo% echo %historyo% echo %prfetch% echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- :: BEGIN REGCLEANR set regcl=Cleaning the registry...Please Wait echo %regcl% echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- echo Defragment all available drives...Pending C:\Progra~1\RegCleaner\RegCleanr.exe /Automatic Cleanup Mode if not errorlevel 1 goto success set regcl=Cleaning the registry...Failed goto next :success set regcl=Cleaning the registry...Success :next cls echo %spybot% echo %cleanmg% echo %tempo% echo %tmpo% echo %historyo% echo %prfetch% echo %regcl% echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- :: BEGIN DEFRAG :: Drive C: set status1=Defragmenting echo %status1% C:\ echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- defrag C: if not errorlevel 1 goto success set status1=Failed to defragment goto next :success set status1=Successfully defragmented :next cls echo %spybot% echo %cleanmg% echo %tempo% echo %tmpo% echo %historyo% echo %prfetch% echo %regcl% echo %status1% C:\ echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- :: Drive D: set status2=Defragmenting echo %status2% D:\ echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- defrag D: if not errorlevel 1 goto success set status2=Failed to defragment goto next :success set status2=Successfully defragmented :next cls echo %spybot% echo %cleanmg% echo %tempo% echo %tmpo% echo %historyo% echo %prfetch% echo %regcl% echo %status1% C:\ echo %status2% D:\ echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- :: Drive E: set status3=Defragmenting echo %status3% E:\ echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- defrag E: if not errorlevel 1 goto success set status3=Failed to defragment goto next :success set status3=Successfully defragmented :next cls echo %spybot% echo %cleanmg% echo %tempo% echo %tmpo% echo %historyo% echo %prfetch% echo %regcl% echo %status1% C:\ echo %status2% D:\ echo %status3% E:\ echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- :: Drive F: set status4=Defragmenting echo %status4% F:\ echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- defrag F: if not errorlevel 1 goto success set status4=Failed to defragment goto next :success set status4=Successfully defragmented :next cls echo %spybot% echo %cleanmg% echo %tempo% echo %tmpo% echo %historyo% echo %prfetch% echo %regcl% echo %status1% C:\ echo %status2% D:\ echo %status3% E:\ echo %status4% F:\ echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- :: Drive G: set status5=Defragmenting echo %status5% G:\ echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- defrag G: if not errorlevel 1 goto success set status5=Failed to defragment goto next :success set status5=Successfully defragmented :next cls echo %spybot% echo %cleanmg% echo %tempo% echo %tmpo% echo %historyo% echo %prfetch% echo %regcl% echo %status1% C:\ echo %status2% D:\ echo %status3% E:\ echo %status4% F:\ echo %status5% G:\ echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- :: Drive H: set status6=Defragmenting echo %status6% H:\ echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- defrag H: if not errorlevel 1 goto success set status6=Failed to defragment goto next :success set status6=Successfully defragmented :next cls echo %spybot% echo %cleanmg% echo %tempo% echo %tmpo% echo %historyo% echo %prfetch% echo %regcl% echo %status1% C:\ echo %status2% D:\ echo %status3% E:\ echo %status4% F:\ echo %status5% G:\ echo %status6% H:\ :: END echo -- -- -- echo COMPLETE echo -- -- -- pause |
|
|
|
|
|
Top | #3 |
|
OSNN Senior Addict
Joined: February 2003
Posts: 932
Reputation: 300
Power: 126 |
More major changes:
* added interface!!! * changed colours!!!! * completly different logic * if spybot or regclean is not found the download page opens itself * added "**run all** option, only displays a summary at the end, then terminates on any key * turned it back into just a BAT file no more EXE I couldn't fit the entire source, but listed below is everything except the **run all** option. Code:
@ECHO OFF
COLOR 17
TITLE RUNNING...
CLS
GOTO BEGIN_INPUT
:BEGIN_INPUT
CLS
ECHO.
ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO º CLEANUP OPTIONS: º
ECHO º 1.) SPYBOT - SEARCH AND DESTROY º
ECHO º 2.) WINDOWS DISK CLEANUP º
ECHO º 3.) CLEAR TEMP FILES º
ECHO º 4.) DEFRAG ALL DRIVES º
ECHO º 5.) REGCLEAN º
ECHO º 6.) **RUN ALL** º
ECHO º 7.) EXIT º
ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO.
ECHO.
@SET /P USER_INPUT="What would you like to do? "
@IF /I "%USER_INPUT%"=="1" GOTO SPYBOTSTART
@IF /I "%USER_INPUT%"=="one" GOTO SPYBOTSTART
@IF /I "%USER_INPUT%"=="2" GOTO CLEANMGR
@IF /I "%USER_INPUT%"=="two" GOTO CLEANMGR
@IF /I "%USER_INPUT%"=="3" GOTO CLEARTMP
@IF /I "%USER_INPUT%"=="three" GOTO CLEARTMP
@IF /I "%USER_INPUT%"=="4" GOTO DEFRAGMENT
@IF /I "%USER_INPUT%"=="four" GOTO DEFRAGMENT
@IF /I "%USER_INPUT%"=="5" GOTO REGCLEAN
@IF /I "%USER_INPUT%"=="FIVE" GOTO REGCLEAN
@IF /I "%USER_INPUT%"=="6" GOTO MASS
@IF /I "%USER_INPUT%"=="SIX" GOTO MASS
@IF /I "%USER_INPUT%"=="SEVEN" GOTO EXIT
@IF /I "%USER_INPUT%"=="7" GOTO EXIT
@IF /I "%USER_INPUT%"=="E" GOTO EXIT
@IF /I "%USER_INPUT%"=="EXIT" GOTO EXIT
ECHO ERROR:Not a valid response
PAUSE
GOTO BEGIN_INPUT
:SPYBOTSTART
@IF EXIST %SYSTEMDRIVE%\Progra~1\Spybot~1\SpybotSD.exe GOTO RUNSPYBOT
ECHO !SPYBOTSD.exe NOT FOUND
START http://www.safer-networking.org/files/spybotsd13.exe
PAUSE
GOTO BEGIN_INPUT
:RUNSPYBOT
ECHO SPYBOTSD.EXE found starting program...
%SYSTEMDRIVE%\Progra~1\Spybot~1\SpybotSD.exe /autoupdate /autoimmunize /autocheck /autofix /autoclose
IF NOT ERRORLEVEL 1 GOTO SUCCESS
ECHO.
ECHO !SPYBOTSD.EXE failed to finish
PAUSE
GOTO BEGIN_INPUT
:SUCCESS
ECHO.
ECHO SPYBOTSD.EXE closed successfully
PAUSE
GOTO BEGIN_INPUT
:REGCLEAN
@IF EXIST %SYSTEMDRIVE%\Progra~1\RegCleaner\RegCleanr.exe GOTO RUNCLEAN
ECHO !REGCLEANR.EXE NOT FOUND
START http://www.majorgeeks.com/download460.html
PAUSE
GOTO BEGIN_INPUT
:RUNCLEAN
ECHO REGCLEANR.EXE.EXE found starting program...
%SYSTEMDRIVE%\Progra~1\RegCleaner\RegCleanr.exe /Automatic Cleanup Mode
IF NOT ERRORLEVEL 1 GOTO SUCCESS
ECHO.
ECHO !REGCLEANR.EXE failed to finish
PAUSE
GOTO BEGIN_INPUT
:SUCCESS
ECHO.
ECHO REGCLEANR.EXE closed successfully
PAUSE
GOTO BEGIN_INPUT
:CLEANMGR
@IF EXIST %TEMP%.\SETDONE GOTO RUNCLEANMGR
ECHO !Configure CLEANMGR before proceeding
CLEANMGR /SAGESET:N
MD %TEMP%.\SETDONE
IF ERRORLEVEL 1 GOTO RUNCLEANMGR
IF NOT ERRORLEVEL 1 GOTO RUNCLEANMGR
:RUNCLEANMGR
CLEANMGR /SAGERUN:N
IF NOT ERRORLEVEL 1 GOTO SUCCESS
ECHO.
ECHO !CLEANMGR.EXE failed to finish
PAUSE
GOTO BEGIN_INPUT
:SUCCESS
ECHO.
ECHO CLEANMGR.EXE closed successfully
PAUSE
GOTO BEGIN_INPUT
:CLEARTMP
DEL %TEMP%\*.* /q
SET TEMPO=úDelete files in %TEMP% successful
IF NOT ERRORLEVEL 1 GOTO NEXT
SET TEMPO=!Delete files in %TEMP% failed
:NEXT
DEL %TMP%\*.* /q
SET TMPO=úDelete files in %TMP% successful
IF NOT ERRORLEVEL 1 GOTO NEXT
SET TMPO=!Delete files in %TMP% failed
:NEXT
DEL %SYSTEMROOT%\prefetch\*.* /q
SET PRFETCH=úClear prefetch successful
IF NOT ERRORLEVEL 1 GOTO NEXT
set PRFETCH=!Clear prefetch failed
:NEXT
ECHO.
ECHO %TEMPO%
ECHO %TMPO%
ECHO %PRFETCH%
PAUSE
GOTO BEGIN_INPUT
:DEFRAGMENT
CLS
SET status1=Defragmenting
echo %status1% C:\
echo -- -- -- -- -- -- -- -- -- -- -- -- -- --
defrag C:
if not errorlevel 1 goto success
set status1=!Failed to defragment
goto next
:success
set status1=úSuccessfully defragmented
:next
cls
echo %status1% C:\
ECHO.
set status2=Defragmenting
echo -- -- -- -- -- -- -- -- -- -- -- -- -- --
echo %status2% D:\
echo -- -- -- -- -- -- -- -- -- -- -- -- -- --
defrag D:
if not errorlevel 1 goto success
set status2=!Failed to defragment
goto next
:success
set status2=úSuccessfully defragmented
:next
cls
echo %status1% C:\
Echo %status2% D:\
ECHO.
echo -- -- -- -- -- -- -- -- -- -- -- -- -- --
set status3=Defragmenting
Echo %status3% E:\
echo -- -- -- -- -- -- -- -- -- -- -- -- -- --
defrag E:
if not errorlevel 1 goto success
set status3=!Failed to defragment
goto next
:success
set status3=úSuccessfully defragmented
:next
cls
echo %status1% C:\
echo %status2% D:\
echo %status3% E:\
ECHO.
set status4=Defragmenting
echo -- -- -- -- -- -- -- -- -- -- -- -- -- --
echo %status4% F:\
echo -- -- -- -- -- -- -- -- -- -- -- -- -- --
defrag F:
If not errorlevel 1 goto success
set status4=!Failed to defragment
goto next
:success
set status4=úSuccessfully defragmented
:next
cls
echo %status1% C:\
echo %status2% D:\
echo %status3% E:\
echo %status4% F:\
ECHO.
set status5=Defragmenting
echo -- -- -- -- -- -- -- -- -- -- -- -- -- --
echo %status5% G:\
echo -- -- -- -- -- -- -- -- -- -- -- -- -- --
defrag G:
If not errorlevel 1 goto success
set status5=!Failed to defragment
goto next
:success
set status5=úSuccessfully defragmented
:next
cls
echo %status1% C:\
echo %status2% D:\
echo %status3% E:\
echo %status4% F:\
echo %status5% G:\
ECHO.
set status6=Defragmenting
echo -- -- -- -- -- -- -- -- -- -- -- -- -- --
echo %status6% H:\
echo -- -- -- -- -- -- -- -- -- -- -- -- -- --
defrag H:
if not errorlevel 1 goto success
set status6=!Failed to defragment
goto next
:success
set status6=úSuccessfully defragmented
:next
cls
echo %status1% C:\
echo %status2% D:\
echo %status3% E:\
echo %status4% F:\
echo %status5% G:\
echo %status6% H:\
ECHO.
PAUSE
GOTO BEGIN_INPUT
::::::::::::::::::::::::::::::::::::::::
|
|
|
|
|
|
Top | #4 |
|
OSNN Veteran Addict
Joined: March 2002
Location: United Kingdom
Posts: 7,805
Reputation: 1490
Power: 217 |
looking quite cool
|
|
|
|
|
|
Top | #5 |
|
_________________
Joined: July 2002
Posts: 1,557
Reputation: 160
Power: 136 |
Nice work.
Just one question. Why did you include prefetch? Deleting the files in this folder defeats the purpose of prefetch. |
|
|
|
|
|
Top | #6 |
|
OSNN Godlike Veteran
Joined: January 2002
Location: new york
Posts: 12,258
Reputation: 4333
Power: 291 |
/agrees with yoyo , in both regards chaos...it is nice work, and also agrees with him about no benefit to deleating the prefetch contents
that "clear prefetch" is a counter productive tweak...personally, I don't think it should be done at all, but if at all, maybe once every couple of months at the most; Windows XP speeds up system boot by observing the code and data needed each time the system is booted and prefetching the necessary file contents early in the boot process...it will also put this info on an optimum spot on the disk it will then defrag the prefetch info. now, does deleting this folder still make sense?...optimization on disc will have to begin all over again when this file is deleted my operating systems are definately faster a couple of months into the install then the beginning, and prefetch is one of the reasons I'll tell you what is an excellant item to include; Code:
%windir%\Prefetch\Layout.ini this usually doesn't happen but for once every three days, so this item would be nice in your file be advised however, the disc optimizations in xp do not cross volume, so though the do some good on partitioned drives, for the most part, your applications need to be on "c" in order to get full benenfit. this is the main reason some people do not notice a gain with prefetch enabled but ya chaos really nice job |
|
|
|
|
|
Top | #7 |
|
OSNN Senior Addict
Joined: February 2003
Posts: 932
Reputation: 300
Power: 126 |
Thanks for the input all, I think I'll be figuring out a different programming language pretty quick here to make a nice easy interface.
I did some minor improvements, but I wasn't exactly sure how to implement that Layout.ini function. *interface revisions *spelling revisions *main menu's logic and response to errors *removed prefetch in options 3 + 6 |
|
|
|
|
|
Top | #8 |
|
OSNN Veteran Addict
Joined: April 2003
Location: In The Void
Posts: 6,373
Blog Entries: 9
Reputation: 1877
Power: 193 |
nice tool found it and used it this morn - saves me clicking here there and everywhere to run the same progs, one little suggestion/idear - how about adding adaware to the list - if its possible that is?
Have already sent it to a few friends and they v happy with it also
|
|
|
|
|
|
Top | #9 |
|
OSNN Senior Addict
Joined: February 2003
Posts: 932
Reputation: 300
Power: 126 |
I decided the script was getting a bit bloated so I dumbed the entire thing back down to what it was supposed to be in the first place, an easy way to automatically run the disk services I wanted.
All directories are defaulted to the %systemdrive% that would be 'C:' in most people's cases. Instead of making the entire thing one big script, I broke each program up into it's own module that can be removed or added to. I've also added documentation to the modules so anyone can easlity add functinality to the scripts, ie, more drives cleaned/defraged, or adding custom modules. New version: * Installer/Uninstaller * New Interface * added Adware support * defrag only defrags 'C:' (unless otherwise specifed) * adware only scans 'C:' (unless otherwise specifed) |
|
|
|
|
|
Top | #10 |
|
OSNN Senior Addict
Joined: February 2003
Posts: 932
Reputation: 300
Power: 126 |
This is going to be the last release for a while. There are very few bugs left, even as picky as I am. Read the official ‘Read Me’ file in the package for more documentation. It was quite an interesting development, but I’m glad it’s finally coming to an end, and am quite happy with the final result. Thank you for your support.
Features (tested only on the listed version, may or may not work on others):
Added in this version:
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Automated system install | Steevo | Windows Desktop Systems | 5 | December 23rd, 2005 12:59pm |
| FireTune - the very first automated optimizer for Firefox | ShepsCrook | Windows Desktop Systems | 0 | April 19th, 2005 2:01pm |
| Automated applications | BouncingSoul | Windows Desktop Systems | 2 | November 7th, 2003 12:26am |
| Automated Setup | ming | Windows Desktop Systems | 8 | August 15th, 2003 9:02pm |
| Broken automated d/l | xflower | Windows Desktop Systems | 2 | January 12th, 2002 3:34pm |