Corrupted system files don't have to ruin your day
Nothing will put a crimp in your computing style quite like a Windows error. Although Microsoft's OS has gotten exponentially more stable over the years, it's still very possible for Windows system files to become corrupt, which can cause your system to slow down, freeze, or (in the worst case) refuse to load your operating system at all.
When you encounter a Windows error, your first instinct may be to back up your data, grab the ol' installation disk, and weep silently as you press the Reformat button. We're here to tell you there's another way. Still back up your data, of course, but by following this guide, you might well be able to repair your Windows install without dropping the nuke.
Note: Though these guides are written for Windows 7, a very similar process will work for Vista or XP.
Method 1: Repair Windows Even If You Can't Get To Your Desktop
The first method will allow you to repair corrupt system files, even if the problem is so severe that you can't boot all the way to your desktop. For this method, you'll need a Windows installation DVD, so track down yours or borrow one from a friend—it doesn't matter if the DVD's version matches your license, as long as it's the correct bit count.
Step 1: Insert the Install Disc and Reboot
If your system won't boot into Windows, you'll need to boot from somewhere else—in this case, the installation DVD. Your computer should be set up to boot from your optical drive before your hard drive, but if it's not, you can always change the boot priority in the BIOS. When the system starts up, make sure you press a key when prompted to boot from the Windows installation disc. When you do, you'll see the familiar Windows installation language-selection screen (image below).
Step 2: Get to the Command Prompt
The recovery tool we're going to use is run from the command prompt, which can (thankfully) be accessed through the Windows installation disc. To get there, don't click Install Now in the middle of the screen, but instead click Repair Your Computer in the lower left. Click Next on the first menu that pops up.
The next menu will have two radio buttons. Make sure the first one is selected, and note that in the text box, your System drive might not have the drive letter C. If that's the case, make a note of the drive letter used. Click Next, and on the following screen (image above), select the bottom option, marked Command Prompt.
Step 3: Scan Your System
Finally you're ready to scan your system files for errors. To do that simply run the following command:
sfc /scannow /offbootdir=[DRIVELETTER]:\ /offwindir=[DRIVELETTER]:\windows
Substitute the drive letter you noted earlier for [DRIVELETTER]. There should be no square brackets in the command (image below).
Windows will now attempt to find and repair any errors in your system files. If the scan finds errors, you may need to repeat the steps in this guide until it finds no more errors. To restart your computer, enter the exit command, then click the Restart button. When you're ready to try booting into Windows again, remove the install disc and restart one final time.
Method 2: Reinstall Windows Without Losing Any Data
If you are still able to get to your desktop, you've got additional options. You can still use the command prompt to scan as in the previous method, but there's another way that may be more thorough: reinstall Windows.
Wait, didn't we say you wouldn't have to reformat? We did, and you don't. It's possible to do an in-place, nondestructive reinstall of Windows, which will restore all your system files to pristine condition without damaging any of your personal data or installed programs. All you'll need is a Windows install DVD and your Windows CD key. Hopefully you still have your key written down somewhere, but if you don't, you're not out of luck. You can use a program like ProduKey, available for free, to quickly recover your Windows product key from the registry.
Important: Before continuing this process, note that it can cause problems with your installed programs, so don't do it just for fun, and make sure to back up your important data and create a restore point before continuing.
Step 1: Do Some Prep Work
Before you can get started, there's one important consideration: You can't repair a Windows 7 SP1 install with a pre-SP1 install disc. The ideal solution is to borrow a newer install disc with SP1 included (or download it, if you have access to a TechNet account), but it's also possible to uninstall SP1. To do this, open the Control Panel, select Uninstall a Program, and then choose the option to view updates (image below). You can right-click the Service Pack update to uninstall it.
Step 2: Insert the Install Disc
We're once again using the Windows install disc, but this time we're not going to boot from it. Simply insert the disc, and when the autorun menu pops up, choose to run setup.exe. Once again, you'll find yourself staring at the Windows 7 install screen. This time, do click the Install now button (image below).
Step 3: Reinstall Windows
Finally, it's time to get down to business. After the installer gets past the Copying Temporary Files… screen, you'll be asked about getting updates for installation files. Go ahead and do this, as long as your computer's network connection is still working.
When the installer asks what sort of installation you'd like to perform (image below), ignore your natural instinct to choose Custom, and instead click Upgrade. Sure, you're not technically upgrading from one version of Windows to another, but we do want to do the kind of nondestructive install that the update option performs. Think of it as upgrading from a broken version to a non-broken version, if you must.
After that, all that's left is to sit through the usual Windows 7 installation process, with its multiple reboots and endless progress bars. When it's done, you'll have to reactivate Windows by entering the product key that you found or wrote down earlier.
All that's left to do is to let Windows install any security updates or service packs that it's missing, and reboot. All your system files should now be fully restored!