If you do setup windows again, it should fix it (depending on OS, works for 95 and 98). Setup your PC to boot from CD-ROM, place the Windows CD in your tray. It should automatically run the Windows setup. If possible, choose the repair option (typically its not available unless Windows is really screwed). Otherwise, choose to go ahead and overwrite the current OS. It should save all program links (meaning you don't have to reinstall any software) and will only put Windows back to default.
Thats assuming you have used an updated anti-virus program to detect any virii on your system that could be causing this problem.
-SW