For as long as I can remember having it, my 98SE machine has had trouble shutting down. I hit "Shutdown" and the screen dims, but it almost always chokes up right there and never actually shuts down. When these lockups occured, I had been resorting to a convoluted process of hitting Ctrl-Alt-Del to bring up the task manager and killing the RunDLL32 process that was running the shutdown procedure. Then running Sysinternals.com's excellent Process Explorer (thanks j_b!) and using it to kill Explorer.exe (a process NOT listed in the normal task manager). That accomplished, I closed Process Explorer, and used C-A-D again to bring up the shutdown dialog, and hit "Shutdown." The machine would then generally shut down correctly.
I was reading some 98 tweaks site linked from the comments of the recent Slashdot story about "how much virtual memory is enough" and went into my Virtual Memory settings in the Performance tab of the My Computer/Properties menu. The settings were max 1306 MB of VM, min 0. This seemed a little odd to me, so I set it to 512 MB min *and* max. The idea being, that will prevent Windows from resizing the swap file on the fly all the time and causing (more) performance degradation or (further) fragmentation in filesystem.
The change was immediate and dramatic. The box has shut down cleanly every time since I made this change. I haven't had a single problem shutting down since. It's only been a couple of days, but I'm still inclined to call this a freaking miracle cure. With only 512 MB of real RAM on this machine, I may occasionally run out of memory when using PhotoShop on multiple huge images. And it may be interesting if I ever start up Far Cry again. But all in all, this is the best fix I've ever done on a Windows box. If you're still running Win9X and have problems shutting down, give it a whirl.