Tuesday, March 24, 2009

Scheduling a Weekly Defrag in Windows

Just a tip if you want to have your computer defragment itself every week. I found an article titled Windows XP: Schedule a weekly defragmentation that gives nice pictures and makes it easy for the most basic computer user.
If it seems like your computer has gotten slower since you bought it, it probably has. One of the biggest factors that slows down your computer’s performance is fragmentation, a situation that occurs over time, in which files on your hard drive become divided into small pieces. Your computer must read a file to open, save, or close it. So when it reads each piece of a fragmented file separately, the effect is that the file can seem “slow” when you’re working with it.

Defragmenting your hard drive is the process of putting all the scattered pieces of files back together. Microsoft Windows XP includes a tool that will defragment your hard drive for you. To keep your system performing well, it’s a good idea to have Windows XP automatically defragment your hard drive every week.

Just a note, there are some helpful command line options for Windows XP and Windows Server 2003:
defrag <volume> [-a] [-f] [-v] [-?]
volume drive letter or mount point (d: or d:\vol\mountpoint)
-a Analyze only
-f Force defragmentation even if free space is low
-v Verbose output
-? Display this help text

On Vista and Server 2008, there seem to be a few more options according to this article:
The list of supported command line parameters for "defrag.exe" is the following:

  • drive letter - this parameter specifies the drive letter or the mount point path of the volume that will be analyzed or defragmented. (e.g. "defrag c:" or "defrag e:\volume\mountpoint");

  • -c - using this parameters forces "defrag.exe" to defragment all volumes on your computer. (e.g. "defrag -c");

  • -a - performs only fragmentation analysis and it doesn't defragment the specified drive. (e.g. "defrag d: -a");

  • -r - performs a partial defragmentation which consolidates only the fragments which are smaller than 64 MB. This is the default setting. This means that "defrag v:" and "defrag v: -r" are equivalent and the Disk Defragmenter will perform the same type of defragmentation;

  • -w - when you use this switch, "defrag.exe" will perform a full defragmentation, regardless of the fragments size. (e.g. "defrag c: -w");

  • -f - forces the defragmentation even if the free space is lower than 15%. (e.g. "defrag c: -f");

  • -v - verbose mode. In this mode, "defrag.exe" will show a detailed analysis and defragmentation output. (e.g. "defrag d: -v");

  • -? - displays help information about how to use "defrag.exe". (e.g. "defrag -?").

No comments:

Post a Comment