The complete instructions for fixing this problem are
here.
The KB article above assumes you will be using a Windows CD and repair console, but you could also perform the tasks listed in the article by temporarily installing the hard drive as secondary drive in another computer. Either way, it is a pretty involved repair that requires copying files and changing file ownership / permissions.