Copied from link below. More info available in the link.
http://www.toejumper.net/maintain4/defrag4.htm
Keep in mind that you need to have at least fifteen percent free space on your hard drive for Defrag to run properly, otherwise it will only partially defragment your hard drive.
------------------------------------------------------------------------------------------------------------
Sometimes Defrag hangs, continuing to restart without ever reaching completion. There are numerous reasons why Defrag does this. First, make sure you give it plenty of time to get its job done. It's not unusual for Defrag to seemingly hang around the 10% mark; what it's really doing is figuring out how to reorganize your files and data clusters. If it really does hang, it'll present you with a message something like, "Defrag has been forced to restart 10 times or more...." and give you the option to restart again or cancel. If this happens, run ScanDisk in Thorough mode to ensure that the disk is problem-free (you may need to close Windows and run it from the DOS prompt if ScanDisk, too, hangs -- restart your PC in DOS mode and enter SCANDISK at the C: prompt. Make sure no other programs are running while Defrag is doing its thing -- press Ctrl-Alt-Del to bring up the Task Manager, and click "End Task" for all unnecessary programs (i.e. everything except Explorer and Systray). Disable your screen saver. Finally, clear some of the deadwood from your hard drive; Defrag can work more efficiently without a drive full of clutter and crap. If none of this works, Defrag isn't up to the job of handling your rubbish heap of a hard drive. Try one of the major utilities programs instead, or call for help.
----------------------------------------------------------------------------------------------------------------------------------------
Run ScanDisk (see above) before running Defrag, to check your file system for errors which could turn perfectly good material into "lost clusters."
-----------------------------------------------------------------------------------------------------------------------------------------
Expect Defrag to take a good while, especially if your drive is heavily fragmented. Take your much-neglected sweetie to dinner, and disable the screen saver before you go. If it seems to hang, leave it alone for a while -- it is probably working on a particularly fragmented section of hard drive and while it seems to have locked, it is actually busy. (One way to tell is to look at the disk-activity light on your computer. If there is hard disk activity, the light will be on, at least intermittently.) Premature shutdown of Defrag can zap your whole file structure. Hands off for at least an hour. Go to dinner, come back, and if it's still hung, then and only then shut it down.