When your computer writes data to a file on the hard drive, it doesn't always store it in one location. One cluster of data might be at the beginning of the drive, while others are at the end. This can cause programs to run slowly because the computer takes longer to find information scattered across the disk.
Details
Step 1. Remember what not to do.

Keep in mind the following points:
- It was once believed that you needed to boot Windows in "Safe Mode" to defragment. This is not necessary.
- You don't have to uninstall unnecessary programs, but doing so can help free up disk space.
- You don't need to close all other applications and programs before defragmentation.
- You don't need to delete the temporary files folder.
Step 2. If Windows recommends defragmenting your disk, simply click "OK" or "Defragment."

If Windows suggests that you defragment your disk, just click "OK" or "Defragment." It's that easy!
Windows 7
Step 1. Note that different versions of MS Windows display defragmentation options differently.

Be aware that options for defragmenting the disk are displayed differently across various versions of MS Windows. Here’s what the colored fields in the program mean: {| class="wikitable" border="2" cellpadding="4" cellspacing="0" bgcolor="azure"|-| Style="background:blue" | xxx| Style="background:azure; color:black" | BLUE – areas that do not need defragmentation.|-| Style="background:white" || Style="background:azure; color:black" | WHITE – empty space on the disk.|-| Style="background:red" || Style="background:azure; color:black" | RED – fragments of files that need to be gathered together into one piece.|}
Other Versions of Windows
Step 1. Note that in Windows 7, defragmentation occurs automatically.

In Windows 7, defragmentation happens automatically. If you want to defragment manually, follow these instructions:
Step 2. Open the Control Panel.

Step 3. Click on "System and Security."

Step 4. Click on "Defragment your hard drive."

Step 5. Select the disk you want to defragment.

Choose the disk you want to defragment, for example, the "C:" drive.
Step 6. Click on "Analyze Disk."

- Note that the time taken for defragmentation depends on the size of the disk as well as the size of the "red areas" on the disk.
- You can continue working on your computer during the defragmentation process, although it will likely run very slowly. It's best to let the disks defragment overnight.
- If needed, you can pause the defragmentation. Just click "pause." When you click "start" again, the program will continue defragmenting from where it left off.
Step 7. If you want to change the schedule for disk defragmentation, do the following:

- Click "Change schedule."
- Open the menu with the days.
- Select a "Day (e.g., Saturday)."
- Click "OK."
- Click "Close."
Re-Defragmentation
Step 1. Open "My Computer" on your desktop.

Open "My Computer" on your desktop. Right-click on the desired disk. Then click on "Properties." Go to the "Disk Properties" tab.
Step 2. Click on the settings or options tab.

Step 3. Find the "Defragment" option.

From the Command Line
Step 1. You can perform a re-defragmentation.

You can perform a re-defragmentation. During the second defragmentation, the pieces of space with consolidated fragments will be moved to one location, making your computer a bit faster. Re-running the defragmentation optimizes the free space on the disk.
Step 2. Check the report.

Check the report. After defragmentation is complete, a report will appear. See if the files and programs you frequently use have been defragmented. If so, that's great!
Step 3. Defragment individual files.

Defragment individual files. If the report or analysis shows fragmentation in files you often use, employ a special program to line up all the fragments of that file for optimal use. You can download the program here: http://technet.microsoft.com/en-us/sysinternals/bb897428.aspx. This utility can be run from the command line. You can also start it by pressing the "Run" button (in the Start menu).
Method of Defragmentation Using Batch Files
Step 1. Launch the disk defragmentation program.

Step 2. Open the Start menu, then click "Run."

Open the Start menu, then click "Run." Type "dfrg.msc" in the text input field. You can also launch the utility from here: Start – Programs – Accessories – System Tools – Disk Defragmenter. The program window will appear.
Step 3. Click "Analyze" to see how fragmented the disk is.

Click "Analyze" to see how fragmented the disk is. Review the analysis report. Select the desired disk. Click the "Defragment" button.
Step 4. Wait for the defragmentation to finish.

Wait for the defragmentation to finish. The computer will resolve the fragmentation of files.
Apple Mac OS X
Step 1. Open Notepad and create a new document.

Step 2. Enter the following code:

- Type "defrag" to create the disk defragmentation command.
- Enter the letter of the disk you want to defragment. For example: "defrag c:".
- Type the parameter "-v" if you want the program to display additional information about the defragmentation.
- Enter "-a" if you don't want additional information. Note: the -a -v command will display more data.
Step 3. Save the file.

Save the file. Rename the file to have a .bat extension. You've created a batch file. Now run it.
Step 4. Wait.

Wait. Defragmentation can take anywhere from ten minutes to several hours, depending on the size and fullness of the disk.
Part 8
Step 1. Don't worry.

Don't worry. The BSD kernel of the Mac OS X system defragments files immediately upon writing them to the disk.



