Scheduling Disk Defragmenter in Windows XP
Takeaway: You can't schedule a defrag using Task Scheduler, but you can do it from a batch file. Greg Shultz explains how to schedule Windows XP's Disk Defragmenter.
The Microsoft Management Console houses the Windows XP Disk Defragmenter, which makes it impossible to schedule a regular defragmenting session via Task Scheduler. However, there's also a command line version of this utility, called Defrag.exe, that you can schedule. To do so, create a batch file that runs Defrag.exe along with the appropriate parameters, and then create a schedule to run your batch file.
To run Defrag from the batch file, use the following command line:
Defrag x: [/parameter]
In this command, x is the drive letter of the hard disk you want to defragment, and parameter is one of three optional settings that you can use to configure Defrag:
Here's how to schedule the Disk Defragmenter:
- Launch Notepad.
- Type the appropriate Defrag command line.
- Save the file as Defragger.bat.
- Go to Start | All Programs | Accessories | System Tools | Scheduled Tasks.
- Launch the Scheduled Task Wizard by double-clicking Add Scheduled Task.
- Click Next and select Defragger.bat.
- In the following three screens, select the Weekly or Monthly option, the time that you want to defragment your hard disk, and then type a username and password with Administrative privileges.
- Click Finish.
Now, your computer will regularly run a defragmentation operation to keep your Windows XP system in tip-top shape!
Note: This tip applies to both Home and Professional editions.
Miss a tip?
Check out the Windows XP archive, and catch up on our most recent Windows XP tips.
Stay on top of the latest XP tips and tricks with our free Windows XP newsletter, delivered each Thursday. Automatically sign up today!
Print/View all Posts Comments on this article
SponsoredWhite Papers, Webcasts, and Downloads
- CRM Without Compromise: A Strategy for Profitable Growth SAP
- Trust and Competitive Advantage: An Integrated Approach to Governance, Risk Management and Compliance SAP
- Virtual Desktop Infrastructure Parallels
Article Categories
- Security
- Security Solutions, IT Locksmith
- Networking and Communications
- E-mail Administration NetNote, Cisco Routers and Switches
- CIO and IT Management
- Project Management, CIO Issues, Strategies that Scale
- Desktops, Laptops & OS
- Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
- Data Management
- Oracle, SQL Server
- Servers
- Windows NT, Linux NetNote, Windows Server 2003
- Career Development
- Geek Trivia
- Software/Web Development
- Web Development Zone, Visual Basic, .NET

