Every operating system needs an occasional repair job, and Windows 7 is no exception. Whether the source of the problem is corrupt data, a particularly brutal piece of malware, or some other serious issue, you'll occasionally have to reinstall your copy of Windows.
Wiping your hard drive and performing a fresh installation can be a huge headache; but fortunately there's a way to repair a corrupt Windows 7 installation while keeping all your programs, personal data, and user accounts intact. With Windows 7 you can perform an in-place upgrade installation to repair a flaky existing install. Though technically designed to upgrade older Windows operating systems like Vista, the in-place upgrade installation option can also be used to repair an existing installation of Windows 7.
Note that you must perform the in-place upgrade process from within Windows; if your PC can't fully boot to the Windows desktop, this repair guide is not for you. A few other limitations come up later in the article, so be sure to read the entire guide thoroughly before attempting to repair your corrupt copy of Windows 7. Performing a repair installation should be your last resort, and you should consider it only if you have already removed spyware from your PC, reinstalled your drivers, and unsuccessfully tried to restore from an earlier (working) version of Windows 7 using System Restore.
Prepare Your PC for Windows 7
Before performing a repair installation, you should take a few precautionary measures to ensure that the process goes smoothly. The first step is to back up all of your critical files to an external storage device. Though the repair process is unlikely to fail or to render any of your files unrecoverable, it's always a smart idea to back up your data.
After you've backed up your system's important data, we recommend uninstalling any third-party security software such as firewalls or antivirus applications. You can always reinstall them after completing the repair process; but since you'll be initiating this process from within Windows, you need to remove any security applications that actively scan files. You should also download and store all of the drivers that your system needs to function--especially the network controller, which tells your network adapter how to access the Internet.
After backing up all of your drivers, clean out all of the temporary files and junk data that have accumulated in Windows 7 over the course of prolonged use. To do this, click the Start button, and in the Search field type Folder Options; then press Enter. In the Folder Options window, click the View tab and select Show hidden files, folders and drives; then click OK.
Next, initiate a Disk Cleanup by opening the Start menu and selecting Computer; right-click your primary drive (the C: drive by default) and open the Properties menu. Select the Disk Cleanup utility in the lower-right portion of the menu, and select Clean up system files. The Disk Cleanup utility should take a few moments to rescan the drive. Next, click the More Options tab, and select Clean Up in the 'System Restore and Shadow Copies' section at the bottom of the menu. In the dialog box that appears, click the Delete button; then navigate back to the Disk Cleanup tab, confirm that all items in the Files to Delete list are checked, and click OK. The Disk Cleanup utility should clear out outdated system files, temporary data, and other digital detritus. Depending on how much junk data is on your drive, this step may take anywhere from a few seconds to a few minutes.
After running the Disk Cleanup utility, you should clean out a few folders manually. Open the C: drive again, and double-click the Windows folder. Scroll down the list of folders and delete any files in the Prefetch and Temp folders. Be sure to delete only files within those two folders and not the folders themselves. Next, navigate back to the C: drive, and double-click the Users folder. Within the Users folder, double-click first the folder for your particular username, and then the AppData folder (if you don't see the AppData folder, you must not have selected 'Show hidden files, folders and drives' earlier), the Local folder, and finally the Temp folder. Delete all of the files in this Temp folder as well; then restart your system.
Install Windows 7
Having completed the prep work, you can safely begin the Windows 7 repair installation. You'll need a Windows 7 installation disc that matches the version of Windows already installed on your system, and you'll need at least 10GB of free space on the drive where you intend to install the new version. The installation media must be able to deploy a clean Windows installation, which means that custom recovery discs from your system manufacturer or another OEM probably won't work.
To begin the repair installation process, insert the installation media and run Setup (if it doesn't launch automatically). In the Setup window, click the Install Now button, and you'll have the choice of continuing the installation with downloadable updates or without them. If your Internet connection is working, you should probably choose to download the updates, but you can choose whichever option suits your fancy. Next you must accept the terms of the license and then choose whether to perform an Upgrade installation or a Custom installation. You're repairing a corrupt install, so choose Upgrade (the Custom option won't save your personal files or settings).
After you've selected the Upgrade option, the installer will perform a compatibility check; your system should pass with flying colors, since you were already running the same version of Windows 7, but double-check to confirm that there aren't any red flags. Once the compatibility check is done, press the big Next button, and the Upgrade/Repair installation process will begin.
If the Upgrade option is unavailable for some reason, you can still perform a repair by using a simple workaround: Right-click the Setup file before you run it, and select the Properties menu. From there, navigate to the Compatibility tab, and check Run this program in compatibility mode for:. Then select Windows Vista (Service Pack 2) from the drop-down menu. Be sure to also check the box at the bottom labeled Run this program as an administrator; then click OK. Run the Setup utility again, and the upgrade installation option should be available.
The next few stages of the repair process don't require any user intervention. The installer will gather information about your system, copy the necessary installation files, and then move any personal files or programs over to the fresh version of Windows 7. This process isn't especially fast (a typical repair install took about 40 minutes on our test machine), but the amount of time required will vary from system to system depending on how much data needs to be transferred from one Windows 7 installation to the other.
Though most of the data and programs installed on your original copy of Windows 7 should make the move the new copy, a few things (such as custom themes and sounds) will not. You'll have to reinstall those after completing the fresh install.
Clean Up After the Windows 7 Install
Once the upgrade installation process is complete, you'll be prompted to activate your fresh install and answer a few basic setup questions (time and date, network settings, and so forth). At the end of this setup process Windows, will assess your machine's performance to generate an appropriate Windows Experience Index rating, and then perform a few final updates and repairs to complete the installation. Once the entire installation process is complete, you should poke around in your new version of Windows 7 to verify that all of your files are intact and all of your applications are working properly. Run Windows Update to ensure that your fresh copy of Windows 7 is entirely up to date.
To wrap up the installation process, you need to clear out the old junk data left over from your corrupted version of Windows 7. Windows will store this data in two system folders, labeled $INPLACE.~TR and $WINDOWS.~Q. If everything is working properly, you can delete these two folders, along with some other archived data. Follow the steps we outlined earlier to perform a disk cleanup, select Clean up system files, delete the two folders, and you're done. Congratulations, you've successfully brought your Windows 7 PC back from the brink of corruption! Make sure to keep this guide handy, in case you ever need to repair a corrupted copy of Windows 7 again.