Perhaps, it is because you got too much activity on your hard drive. Like background apps of personal firewall and/or apps for blocking popups that are still in function after you leave the internet.
In any case, you should exit from as many programs on your task bar and system bar that you can. And also run scandisk first before running defrag. so you are sure there are no errors on your hard drive (s). Then if you succeed in defragging the hard drive, it is best to reboot or restart.
Can somebody tell me why is it that when I try to defragment my computer, it shuts down and then I have a hard time getting it started again.