Checkdisk does just that, it checks the hard drive for errors and if the /f switch is specified attempts to fix them.
However, the problem seems more likely to be related to corrupted system files...