Type msconfig in start>run and under general tab>advanced make sure disable fast shutdown is ticked.Another problem that can occur (does with my w98se) is a sound file that executes on windows shutdown for example can cause the system to hang.Go intosettings> control panel>sounds>and disable any sounds you may have that sound off when closing windows.I have found from experience that its best to disable sounds in avast to on my 98se system.If you are running 98 secon edition ,also google for shutdown issues as there is a patch that can help.Bear in mind 98/se is notorious for shutdown issues and doesnt always close processes that are still working.A visual cpu monitor can help as you can see whther theres something still working (using cpu cycles)in the background before shutting down.I would recommend procee explorer (free) from here…
http://www.sysinternals.com/ntw2k/freeware/procexp.shtml
You can set it to show cpu usage in system tray , and also to see what seems to be hogging the cpu.
me