Disk Defragmentation in Vista
Windows Vista now comes with an automatic disk defrag tool that is enabled by default. Specifically, it is set to run at 1am every Wednesday. You can disable or modify this by performing the following steps:
1) Click the “Start Orb”
2) Click the Control Panel
3) Click “System and Maintenance”
4) Finally, choose “Defragment your hard drive” from under “Administrative Tools” (at the bottom of the menu/list).
Or, my favorite/quick way:
1) Press the “Windows Button” on your keyboard, type “Disk Defrag” and press enter.
Again, the power of typing what you want to run in the search field at the bottom of the start menu is a huge time saver. I’ve read a few books now that talk about “Run” missing from the start menu as though it is a horrible thing, with instructions on how to get it back. There really is no need—the search field does the job better than Run ever did. And if you really want run for any reason, pressing “Windows” and “R” together still does the trick.
But I digress…
The defrag menu is as shown in the image below. You can simply uncheck the “Run on a schedule” box to disable it, or pres the “Modify schedule” button to pick a new time.

But that’s for users. What you need is a nice command line interface and you’ve got it here...
defrag
defrag
defrag -c [{-r | -w}] [-f] [-v]
-c = Defragments all volumes on this computer
-a = Performs fragmentation analysis only
-r = Performs partial defragmentation (default). Attempts to consolidate only fragments smaller than 64 megabytes (MB)
-w = Performs full defragmentation. Attempts to consolidate all file fragments, regardless of their size
-f = Forces defragmentation of the volume when free space is low
-v = Verbose mode; the defragmentation and analysis output is more detailed
For example, to check how things are doing on one of my test systems, I ran “defrag c: -a” and got the following back at the command line (note that you must run the command prompt as Admin).
Windows Disk Defragmenter
Copyright (c) 2006 Microsoft Corp.
Analysis report for volume C:
Volume size = 16.00 GB
Free space = 7.92 GB
Largest free space extent = 4.78 GB
Percent file fragmentation = 0 %
Note: On NTFS volumes, file fragments larger than 64MB are not included in the fragmentation statistics
You do not need to defragment this volume.
Ahh... now that feels good.

Email This!
Digg it!
Del.icio.us
Reddit!
Newsvine
Comments
I just got this HP laptop with Vista premium. In system tools, it is not possible to get disk fragmentation statistics. I tried entering this "defrag c: -a" in command screen and nothing happened. Any suggestion to obtain fragmentation statistics would be greatly appreciated.
Posted by: C Tran | April 15, 2007 2:26 PM