I’ve seen many spyware-infested Windows 95/98 boxes that just won’t defrag no matter what you do. Defrag starts, gets part of the way through, then the disk changes and it starts over again. Leave the system alone for dozens of hours and it might finish, but probably not.Microsoft has some remedies, starting with hitting ctrl-alt-del and killing everything except explorer and systray, and disabling your quick launch bar (right-click on the gray bar on the bottom of the screen, select Toolbars, and de-select Quick Launch). That can help, but not always.
I’ve also heard of downloading the Windows ME version of Defrag.exe and running that instead of the older version if you’re running an older version of Windows 9x, since Windows ME’s defrag is supposed to work better. I guess that and the USB support were the only things in Windows ME that worked better.
Disabling your antivirus realtime scanning also helps, since it’s always accessing the disk.
But sometimes even doing those things won’t work. The system in my living room is a prime example. It’s clean, has no spyware or anything else but still won’t defrag. I could blow it away and reinstall, but I’m too lazy. For the most part the system works well enough for what I need it to do, so I’d rather not mess with it too much.
One thing you can do is reboot the system into safe mode, and run Defrag from there. The performance won’t be stellar since Windows will be using generic drivers rather than the optimized drivers for your particular computer, but Windows won’t be running anything else special, so the process will be able to finish without interference. Boot in safe mode, give your computer a few hours, and it will at least have a chance to finish.
Another option is to boot off a live CD, such as BartPE, and run JKDefrag on it. This would give you the advantage of a fully 32-bit environment with better drivers than Windows 9x safe mode, so the defragment will finish more quickly.
Defragmenting this way is terribly inconvenient of course, but like I’ve said before, it’s something you don’t have to do very often. Once a year will probably keep your computer running acceptably.