Wednesday 14 January 2009

Defrag multiple hard drives at once (XP)

What if people using XP wanted to defrag multiple hard drives at once...?
Well I've just recently noticed XP doesn't give you that option, so I set out to figure a way to do it myself...

Thinking that the defrag program can be started via CMD with this syntax...

"
Windows Disk Defragmenter
Copyright (c) 2001 Microsoft Corp. and Executive Software International, Inc.
Usage:
defrag <volume> [-a] [-f] [-v] [-?]
volume drive letter or mount point (d: or d:volmountpoint)
-a Analyze only
-f Force defragmentation even if free space is low
-v Verbose output
-? Display this help text"

First we could create a batch (.bat) file, name it what you like but for this tutorial we'll call
it.... defragmulti.bat

TIP: (You can place it in the Windows directory if you'd like to run it from the Command Prompt so it will be available in the system path)

So say in our computer, we have two hard drives... These are C and D. Easy to remember for the sake of our
tutorial, abCDef....

So using Notepad or a text editor of some sort, type in...

defrag c: -f
defrag d: -f

and then save the file as a .bat file.

To run the defrag just double-click it or run it from the Command Prompt, voila!
To do this simply put in .bat after the name of the file.
Thus gives us our multiple hard drive defragment batch file. A big name for something so small,
but who cares?

1 comment:

  1. As it is known to all computer users that it will cause more time to access a data when it is saved in different places. Moreover, when booting up the computer or running a program, it needs some time to load itself, if combines with the time to access the required data from multiple locations,

    ReplyDelete