WindowsDevCenter.com
oreilly.comSafari Books Online.Conferences.

advertisement


AddThis Social Bookmark Button

Hands-Free Disk Defragmenting

by Mitch Tulloch
10/04/2005

A fragmented hard drive can quickly become a performance bottleneck for your Windows XP system. The Disk Defragmenter snap-in that's part of the Computer Management console is a "lite" version of Diskeeper's defragmentation software, and unfortunately it doesn't include a built-in scheduling feature. But defrag.exe, the command-line version of the Disk Defragmenter snap-in, can be used together with the Scheduled Tasks wizard (or the schtasks.exe command-line tool) to schedule defragmenting of your hard disk volumes during off hours.

Before you do this, a warning--don't schedule defragmentation at the same time that the Windows XP Backup utility is backing up your drive, or defragmentation won't complete.

Using the Scheduled Tasks Wizard

Using the Scheduled Tasks wizard to schedule a defragmentation is straightforward. Select Start-->All Program-->Accessories-->System Tools-->Scheduled Tasks to open the Scheduled Tasks folder. Double-click on Add Scheduled Task to start the wizard. Then click Next, click the Browse button, and select defrag.exe from the %systemroot%\system32 folder. Then specify a name for your task and a frequency for running it:

Figure 1
Figure 1: Scheduling a defrag operation.

Click Next and finish specifying your defrag schedule:

Figure 2
Figure 2: More scheduling options.

Click Next again and specify the credentials under which your task will run. These credentials should be an administrator account on the local machine:

Figure 3
Figure 3: Specify admin-level credentials for running defrag.exe.

Pages: 1, 2

Next Pagearrow