SEARCH

How-To Geek

Create Your Own Windows 7 Style Automatic Defrag in Windows XP

One of the cool features in Vista and Windows 7 is it’s set to automatically defrag your hard drive by default on a weekly basis. If you’re still using XP, here’s how you can set it up to work similarly to Vista or Windows 7.

Defragging your hard drive ensures that the data on the disk is in contiguous order for easier access to files and programs. Although the jury is still out on whether or not it improves performance on the newest machines, it’s good to know your drive is always in order. By default, it’s set to run weekly in Vista and Windows 7, and here we’ll look at making it run automatically in XP like it does in the newer versions of Windows.

Defrag in Windows 7 & Vista

Windows 7 & Vista will automatically defrag your hard drive when it’s idle and the feature works well. In Windows 7 it’s set to run at 1am every Wednesday as a low priority background task. Of course you can also change the defrag schedule or turn it completely off if you want.

sshot-2010-09-25-[23-47-08]

Defrag in XP

On older XP machines, defragging the drive is a recommended task for best performance, but it’s not enabled by default. There are a couple of ways to access Disk Defragmenter in XP.

A quick way is to go to Start \ Run and type in dfrg.msc and hit Enter or click OK.

sshot-2010-09-26-[16-43-25] 

Alternately, you can open My Computer, right-click on your local drive, and select Properties.

sshot-2010-09-26-[16-44-32]

In the Local Disk Properties screen click the Tools tab, then Defragment Now.

sshot-2010-09-26-[16-44-46]

Disk Defragmenter opens and you can analyze your drive, view a report, or kick off the defrag process manually. One of the cool things available in XP Defrag when analyzing your disk is the GUI.

sshot-2010-09-26-[16-50-30]

You can still analyze your disk in Windows 7 or Vista, but don’t get the graphical interface.

sshot-2010-09-25-[23-42-19]

Make XP Defrag Run Like in Vista or Windows 7

If you want Disk Defragmenter to work like it does in Vista or Windows 7, we need to create a Scheduled Task. Open Control Panel in Classic View and open Scheduled Tasks.

sshot-2010-09-26-[17-50-28]

The Scheduled Task Wizard kicks off and when you come to the screen to select the program to run, click the Browse button.

sshot-2010-09-26-[17-52-37]

Now enter the following into the File name field and click Open.

%systemroot%\system32\defrag.exe

sshot-2010-09-26-[17-53-21]

Give the task a name…it will be defrag by default but you can name it to whatever you want. Make sure to select Weekly and click Next.

sshot-2010-09-26-[17-53-55]

For the Start time enter 1:00 AM, run every week, and for the day select Wednesday.

Note: This is what the Windows 7 default schedule is. Of course you can set it to whatever you want, but here we want to make it the same as the Windows 7 default.

sshot-2010-09-26-[17-54-16]

The default user name will automatically be entered, and you’ll need to enter the correct password.

sshot-2010-09-26-[17-56-26]

Now that everything looks good and is correctly scheduled, make sure to check Open advanced properties for this task when I click Finish.

sshot-2010-09-26-[17-56-41]

When Advanced Properties opens in the Run field after defrag.exe enter a space then the letter of your local drive, in most cases it’s the C: drive…click OK.

sshot-2010-09-26-[21-19-37]

You might also want to go into Settings and have your PC wake up to run the task and adjust the idle time.

sshot-2010-09-26-[23-40-26]

You’ll be prompted to enter in your login credentials again and click OK.

sshot-2010-09-26-[21-20-48]

Now you’ll see an icon for your new Defrag Scheduled Task.

sshot-2010-09-26-[21-21-38]

When it runs, the Command Prompt screen will open and run an analysis and complete the defrag process.

sshot-2010-09-26-[22-00-41]

You won’t see it running via the GUI but it’s running in the background. If you open up Task Manager you’ll see the process running.

sshot-2010-09-26-[22-02-02]

That is all there is to it. Now your XP machine is set to automatically defrag the local hard drive just like it does in Vista and Windows 7. If you want to get a better handle on the defrag feature in all three versions of Windows, we have several different other articles you can check out!

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 09/28/10

Comments (5)

  1. bkj216

    Even tho this is useful…just let XP die already!

  2. scott7876

    If this is set up to run at 1 AM like the example here, and the PC is not on at 1 AM, will it run the first time the PC is turned on after the 1 AM scheduled time?

  3. Art

    I found the mistake at your article.

    A quick way is to go to Start \ Run and type in dfr.msc and hit Enter or click OK.

    And right:

    A quick way is to go to Start \ Run and type in dfrg.msc and hit Enter or click OK.

  4. Geraldo

    What if we have 2 drives? Do we have to make another schedule?

  5. Ahmed

    Geraldo: Yes, that is correct.

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!