To manual defrag your hard drive: Click start | Programs (or All Programs) | Accessories | System Tools | Disk Defragmenter.
It’s always best to defrag a disk when it’s not in use. To set up Windows to defrag a drive automatically at a certain time, open up Notepad, and type defrag.exe followed by a space, the drive letter, and a colon.
To get Windows to generate a report on the defrag when it’s done and save the report to a text file, enter the following command:
Defrag.exe c: -v >”c:\defrag report.txt”
Of course you can name the text file anything you want.
If you want to defrag more then one drive, create a command line for each drive.
defrag.exe c: -v >”c:\defrag report_c.txt”
defrag.exe d: -v >”c:\defrag report_d.txt”
When your done creating your batch file, click file | save, and make sure to save your batch file using either the .bat or .cmd file extension.
Finally, Window’s Scheduled Task utility lets you defragment automatically at the time of your choice. Click Start | programs (or All Programs) | Accessories | System Tools | Scheduled Tasks. Double click Add Scheduled Task icon, and click next. When prompted for the program to run, click browse and located your batch file. Select it and click open. Follow the remaining prompts to make disk defragmenting occur whenever you want.