This used to happen to me all of the time. I have two hard drives and 5 partitions. I would try to run scandisk and get up the next morning to find a window telling me that scandisk had to restart ten times because something was writing to the disk. Then it would suggest that I shut down all programs - it was quite the puzzle. The answer is that there are many programs running in windows that are not apparent. Here is what I do now and it works all of the time.
Press the Ctrl, the Alt and the Delete keys all at the same time. That will show you all of the programs that are running. Highlight the first one and press 'end task'. Then do the Ctrl / Alt / Delete again and highlight the next one and press 'end task'. Continue doing that until you have ended all of the tasks except Explorer. If you end Explorer, Windows will shut down. When you have ended all of the tasks run scan disk and it will work.
Yes, it is a pain; however, it is the only way I can get it to work with the tools Windows supplies. I don't think running scan disk from DOS is a viable option in Win 98 SE.
Good Luck,
Erwin