Add to Google Reader, Bloglines, Netvibes,Free Weekly Newsletter

As you would know its a pain in the ass when it comes to defraging all hard drives at the same time in Windows XP, as the Disk Defragment utility in Windows Xp doesn’t have any option to defrag all the drives at once.

But a simple batch file trick can get over this problem and defragment all of the drives, one after the other.

The disk defrag utility in Windows XP can be called from the command line with the following 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

To make Windows defrag all the drive at once we need to create file named defrag.bat (you can have any name for this doesn’t matters if its iloveu.bat) . Now for each hard drive, assign a line to the batch file. For instance, if we want to defragment drives C: , D: , F: and G: we will add these three lines:

defrag c: -f
defrag d: -f
defrag f: -f
defrag g: -f

Now to defrag at once, just either double-click on the batch file or start it from the command line.



If you enjoyed this post, make sure you subscribe to the RSS feed! You can also subscribe by Email and have new posts sent directly to your inbox.





Comments

  1. 1
    Jalaj
    November 6th, 2007 at 2:02 pm

    I find the same problem with Win2k and it denies creating multiple instances of defragmentor

  2. 2
    Th3R1pp3r
    November 6th, 2007 at 8:57 pm

    Great Guide!!.. Thumbs Up ;)

    I recently was trying to Defrag multiple hard drive partitions…

  3. 3
    Pranjal
    November 6th, 2007 at 9:09 pm

    did it worked or not.

  4. 4
    Pranjal
    November 6th, 2007 at 9:10 pm

    Nice that it worked out…

  5. 5
    dorusone
    November 11th, 2007 at 12:32 pm

    A better Defrag is Powerdefrag from sysinternals
    (google for it) very little Ram consuming so
    you can run it anytime you want. For the “mutiple part”
    of this advice : i suppose it’s possible.

Leave a Comment

Comment Policy : Any comments are permitted only because the site owner is letting you post, and any comments could be removed for any reason at the absolute discretion of the site owner. Besides that comments may take time to appear.

blank