How To: Set up to automatically defragment
Learn from our various Guides, plus check out our FAQ's and How To's. There is something for everyone. Share what you know and add to the collection.

Moderators: Management, Forum Experts

New version.

Postby l33t on Sun Dec 17, 2006 1:58 pm

i mostly fixed spelling and added a few things to help with program structure. other than that... just cleaned it up a bit and added the ability for a second drive to be passed on from the same CL

im still to lazy to add error handling... i might later (idk... i got a lot to do this xmas break)
enough chit chat.. hers the code. just copy all the text below and save it (useing your favorite text editor) and save it as def.bat inside your windows directory (C:\WINDOWS\def.bat) and run it from the run dialogue (winkey + R)

this version WILL output funny stuff or might crash (again, i cant test this right now) if you do not pass along VALID drive letters for your second (and first, DUH) drives. AKA: you MUST specify a second drive to e defragmented (even if it is the same as the first one.)

to defragment your C and D drives you must type (at the run dialogue)

Code: Select all
def C: D:


here is the program


post bugs and il fix them and ad more code so that you do not HAVE to specify a second drive letter.

enjoy.. and remember.. i HAVE NOT BEEN ABLE TO TEST the latest version yet.

Code: Select all
@echo off
init:
title Defragger v2.56.3 drives: %1% , %2%
color 0a
echo ----------------------------WELCOME-----------------------------
echo i am a defragging utility, i will defragment your hard disk. 
echo this will perform 10 passes (this can, and in all likely hood
echo will, take quite a long time.)
echo its best to let me run over night or something.
echo -------------------------------------------------------------------------
echo .
echo .
echo  this code/program is licensed under the "do whatever the hell you want with it" license. 
echo .
echo .
echo ----------------------------------------------------------------
echo By using this program, or any part of it for that matter, you 
echo accept the following terms and conditions.
echo 1) you can do what ever you want with this program, i really don't care. 
echo just don't hold me responsible for anything you or this program may do to anyone or anything
echo ................................................................................................................................................................. 
echo One note that the user should be aware of...
echo all drive letters MUST have a CAPITOL letter AND a COLON (ex:  C: , D: , E: , ect...)
cls
drive1:
cls
echo the drive letter is %1% , i hope this is right!

title %1% pass 1
defrag %1% -b
defrag %1% -v

title %1% pass 2
defrag %1% -b
defrag %1% -v

title %1% pass 3
defrag %1% -b
defrag %1% -v

title %1% pass 4
defrag %1% -b
defrag %1% -v

title %1% pass 5
defrag %1% -b
defrag %1% -v
title %1% pass 6
defrag %1% -b
defrag %1% -v

title %1% pass 7
defrag %1% -b
defrag %1% -v

title %1% pass 8
defrag %1% -b
defrag %1% -v

title %1% pass 9
defrag %1% -b
defrag %1% -v

title %1% pass 10
defrag %1% -b
defrag %1% -v
title DONE with %1%
echo HORRAY! i have finished all 10 passes for your first drive!  now moving on to drive 2 ( %2% )

drive2:
cls
echo the drive letter is %2% , i hope this is right!

title %2% pass 1
defrag %2% -b
defrag %2% -v

title %2% pass 2
defrag %2% -b
defrag %2% -v

title %2% pass 3
defrag %2% -b
defrag %2% -v

title %2% pass 4
defrag %2% -b
defrag %2% -v

title %2% pass 5
defrag %2% -b
defrag %2% -v
title %2% pass 6
defrag %2% -b
defrag %2% -v

title %2% pass 7
defrag %2% -b
defrag %2% -v

title %2% pass 8
defrag %2% -b
defrag %2% -v

title %2% pass 9
defrag %2% -b
defrag %2% -v

title %2% pass 10
defrag %2% -b
defrag %2% -v
title DONE with %2%
cls
echo I am all done
pause
User avatar
l33t
PRO Level 14
PRO Level 14
 
Posts: 974
Joined: Sun May 01, 2005 10:06 pm

Postby kd1966 on Sun Dec 17, 2006 9:13 pm

Wow! That's a lot of typing work for the originator....... and possibly the subsequent editors.........lol

I love the -b option and how much of a difference it makes on old systems........
User avatar
kd1966
PRO MASTER
PRO MASTER
 
Posts: 8081
Joined: Mon Aug 08, 2005 10:00 pm
Location: USA - GSO - NC

Postby gries818 on Sun Dec 17, 2006 10:24 pm

this is the one I use:

Code: Select all
@echo off
echo Defraging Masterboot code
defrag C:\ -b
defrag C:\ -b
defrag C:\ -b
echo Done!
echo Defraging Hard Drive
defrag C:\
defrag C:\
defrag C:\
defrag C:\
defrag C:\
echo Done!
Image

Mac OS 10.5.7 - Personal
Ubuntu Server 9.04 - Server
User avatar
gries818
Support Team
 
Posts: 6022
Joined: Wed Jul 07, 2004 2:28 pm

Postby l33t on Mon Dec 18, 2006 12:50 am

kd1966, not really, just a lot of copy/paste :)

gries818, that works too, the whole idea is to get ppl to tinker w/ it adjust it for their needs.

cheers!
User avatar
l33t
PRO Level 14
PRO Level 14
 
Posts: 974
Joined: Sun May 01, 2005 10:06 pm

Previous

Return to Guides and How To

Who is online

Users browsing this forum: No registered users and 0 guests