Hethu's Techno Babble

Wednesday, September 27, 2006

How to repair your broken Windows

No, this post is not about repairing your house windows.

Just the other day I found that some of the Windows command line utilities fails with an error "The NTVDM CPU has encountered an illegal operation".

The NTVDM CPU has encountered an illegal operation

Something has gone wrong and some Windows files have got corrupted. Not all command line tools generates this error, only some of them. So how do I fix this? Reinstall Windows? That seemed like a bit too extreme under the circumstances.

As it turns out, there is a built-in tool to check for corrupted system files and to automatically restore them from the original Windows CD. The tool is called, quite appropriately, "System File Checker" (SFC).

System File Checker

SFC runs the “Windows File Protection” and restores incorrect versions of protected system files with correct Microsoft versions.

You can run it from a command prompt as
       SFC /SCANNOW

Make sure to have your original Windows CD around if any corrupted files needs to be restored.