This is a common problem.
Disk Defragmenter
is probably restarting because a program that's running (maybe a
background program that you don't
notice like your anti-virus scanner) is changing files on the hard
disk. If that's the problem, you'll see a message at the bottom of
the screen along the lines of "Drive contents changed .... disk
defragmenter restarting ".
To avoid
this problem, reboot your PC and as soon as it says "Starting Windows 98" (just before you get the
colourful Windows 98 logo screen), press F5 and F8 alternately as
fast as you can for a few seconds. That will load Windows in a diagnostics
/ troubleshooting mode by bypassing the startup files (if you get
a menu of options, choose "Safe Mode").
Then try defragmenting your drive again.
If you've
got a fast system, you might not be able to react to the "Starting Windows 98" message
quickly enough (you don't get long to hit to F5 / F8 key). In this
case, you'll
need to start pressing the buttons before the message pops up so
keep an eye out for what is displayed on the screen before the message
appears. You might need to have a few practices at this to time it
right!