A Digital Age Deserves A Digital Leader

How To: Set up to automatically defragment

Postby gries818 » Sat May 13, 2006 10:41 pm

no, go to My Computer-(the drive you have Vista installed on)-Properties-Tools-Defragment and it comes up with a dialog asking/telling you when the auto Defragment is. At least thats the way I remember it... Next time I boot into Vista I will check.
Image

Mac OS 10.6.7 - Personal
Ubuntu Server 11.04 - Server
Software Development
User avatar
Posts: 3991
Joined: Wed Jul 07, 2004 6:28 pm

Postby gries818 » Mon May 15, 2006 12:13 am

gries818 wrote:still have yet to try it with the command prompt.


currently its the same output for the command prompt.
Image

Mac OS 10.6.7 - Personal
Ubuntu Server 11.04 - Server
Software Development
User avatar
Posts: 3991
Joined: Wed Jul 07, 2004 6:28 pm

i made improvements...

Postby l33t » Fri Jun 23, 2006 8:38 pm

i hate to dig this back up, but i didint want to start a new thread.

i made improvments, to the origional script i posted
now the script defragments 10 times... and thats the magic number that i found to get EVERYTHING defragmented...

soooo just copy the text below, save it as def.bat , and put it in your C:\windows folder, and to run it... at the run prompt (winkey + R) type def DEIVE LETTER:

sooo lets say i wanted to defrag my c: drive.
i would type
Code: Select all
 def C:


enjoy!
here is the code.

Code: Select all
@echo off
title DEFRAGGER %1%
color 0a
echo i am a defragging utility, i will defragment your hard disk.  this will perform 10 passes!
echo the first paramater must be passed on as a capitol letter, and have a ":"!!! this is IMPORTANT!!!!

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
pause

echo DONE
PRO Level 14
User avatar
Posts: 882
Joined: Mon May 02, 2005 2:06 am

Postby gries818 » Fri Jun 23, 2006 8:49 pm

^*^
Image

Mac OS 10.6.7 - Personal
Ubuntu Server 11.04 - Server
Software Development
User avatar
Posts: 3991
Joined: Wed Jul 07, 2004 6:28 pm

Postby c0ldfyr3 » Sun Dec 17, 2006 3:21 pm

l33t can i use this same code to defrag multiple drives? if so how. i am a little rusty on commands for DOS.
Image
PRO Level 15
User avatar
Posts: 1346
Joined: Sun May 02, 2004 8:49 pm
Location: 127.0.0.1

Postby gries818 » Sun Dec 17, 2006 3:34 pm

c0ldfyr3 wrote:l33t can i use this same code to defrag multiple drives? if so how. i am a little rusty on commands for DOS.


yeah you could. i am also rusty though i can't really remember. i remember i had trouble with drive letters.
Image

Mac OS 10.6.7 - Personal
Ubuntu Server 11.04 - Server
Software Development
User avatar
Posts: 3991
Joined: Wed Jul 07, 2004 6:28 pm

Postby c0ldfyr3 » Sun Dec 17, 2006 3:46 pm

would it be

Code: Select all
def C: ; B:
Image
PRO Level 15
User avatar
Posts: 1346
Joined: Sun May 02, 2004 8:49 pm
Location: 127.0.0.1

Postby l33t » Sun Dec 17, 2006 5:10 pm

c0ldfyr3 wrote:would it be

Code: Select all
def C: ; B:


i am not in windows ATM an cannot test this, however, i don't think that would work as my "program" just passes the first command line argument to the command "defrag" in the form of a drive letter.

all my
PRO Level 14
User avatar
Posts: 882
Joined: Mon May 02, 2005 2:06 am

New version.

Postby l33t » Sun Dec 17, 2006 5: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
PRO Level 14
User avatar
Posts: 882
Joined: Mon May 02, 2005 2:06 am

Postby kd1966 » Mon Dec 18, 2006 1:13 am

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........
PRO PLATINUM
User avatar
Posts: 6831
Joined: Tue Aug 09, 2005 2:00 am
Location: USA - GSO - NC

PreviousNext

Return to Guides

Who is online

Users browsing this forum: No registered users and 3 guests

cron
cron