How to Defragment Your Computer?

When your computer writes information onto your hard drive, it does not always write information in the same location on the actual hardware. A section of a file can be written near the beginning of the disc, whereas the rest of that file could be written near the end. This causes programs to run slowly, as the computer spends time in retrieving these file clusters from all over the disc. Defragmenting your computer sorts all of your files in an orderly manner, in effort to reduce loading time. Here is how to do it.

Steps

Windows

1. Start Windows in Safe Mode. This is not mandatory, but it helps to avoid complications from other programs that are running in the background. This also speeds up and streamlines the process.
2. Uninstall any programs you do not use or need. It is best to uninstall programs prior to a defragmentation, as the newly-acquired free space will generally be located all over the hard drive, thereby giving rise to fragmentation.
3. Make sure that all unnecessary programs are closed. If you have already started in Safe Mode, then this has already been done.
4. Cancel any programs that are scheduled to run. If you have not manually scheduled any programs to run, then skip this step.
5. Delete any temporary files. This is done by running Disk Cleanup. To run the program, go to: START -> Run, and enter cleanmgr in the window.
6.
Disk Defragmenter with two hard drives.
Disk Defragmenter with two hard drives.
Run the Disk Defragmenter Program. Go to START -> Run, and enter dfrg.msc in the window. Alternatively, launch it by going to Start -> Programs (or All Programs) -> Accessories -> System Tools -> "Disk Defragmenter". A window similar to the one on the right should appear. Click Analyze so you can see what the damage is, and then look at the report. If you want to continue: Make sure that your desired drive is selected [C: being the default drive], and click on the Defragment button.
7. Wait until the process is complete. Sit back and relax as your computer organizes your fragmented files.

Batch Method

Although using batch files to defrag your computer, some actually prefer to see words filled with info than something filled with color.

1. Make a new txt application. On windows you will edit the txt document with Notepad on defult.
2. Make the code.
1. Type in defrag becasue you are obviously going to defrag a disk.
2. Type in the drive letter or mount point that you wish to defragment. For example: defrag c:.
3. Type in parameter -v if you want to see extra data.
4. Type in -a if you just want the data. Note: -a -v will print out a more detailed data.
3. Execute the file. First, rename your file so the extension is .bat. Your file is now a batch file. Next, click on it.
4. Wait. Play games, stare at the clock, get levels on RuneScape, whatever. It takes a long time to defrag a computer.

Source: wikihow