To defragment your hard disk
Open Disk Defragmenter by clicking the Start button . In the search box, type Disk Defragmenter, and then, in the list of results, click Disk Defragmenter.
Under Current status, select the disk you want to defragment. To determine if the disk needs to be defragmented or not, click Analyze disk. If you're prompted for an administrator password or confirmation, type the password or provide confirmation.
Once Windows is finished analyzing the disk, you can check the percentage of fragmentation on the disk in the Last Runcolumn. If the number is above 10%, you should defragment the disk. Click Defragment disk. If you're prompted for an administrator password or confirmation, type the password or provide confirmation.
Disk Defragmenter might take from several minutes to a few hours to finish, depending on the size and degree of fragmentation of your hard disk. You can still use your computer during the defragmentation process.
Notes
If the disk is already in exclusive use by another program or is formatted using a file system other than NTFS file system, FAT, or FAT32, it can't be defragmented.
Network locations can't be defragmented.
If a disk that you're expecting to see under Current status is not showing up there, it might be because it contains an error. Try to repair the disk first, then return to Disk Defragmenter to try again. See Check a drive for errors for more information.