MacMusic  |  PcMusic  |  440 Software  |  440 Forums  |  440TV  |  Zicos
windows
Search

How to repair Windows 10 or 11 in 4 steps

Friday July 26, 2024. 12:00 PM , from ComputerWorld
Sometimes a Windows 10 system starts misbehaving to the point where repair is needed. This often takes the form of worsening performance or stability, and can originate from damage to, loss of, or corruption of Windows system files (normally in the C:Windows folder hierarchy). When that happens, users would be well advised to break out the following routine to help them set things back to rights.

This story provides a sequence of techniques to try if you’re frequently experiencing problems like slowdowns and crashes. All of these methods start with the assumption that you’re at least able to get into the Windows environment. If Windows won’t start up at all, see my story “What to do when Windows won’t boot,” which covers techniques such as WinRE Startup Repair, using a third-party boot repair tool, and more.

I initially wrote this story in 2016, but as Windows 10 has evolved and Windows 11 has emerged, some of these steps have changed a bit. I’ve now updated it for Windows 10 22H2 and Windows 11 23H2, the current versions. Most of the steps are the same in Windows 10 and 11, but as you’ll see, Microsoft has made Step 3 much simpler in Windows 11.

The Windows repair drill

In this exercise, the idea is to march through the steps in order. Thus, first try the initial step in the sequence. If that doesn’t fix what’s broken, advance to the next step. Keep working through these steps in order until you reach the end, and you are bound to fix the vast majority of problems. In fact, the only remaining step at that point would be to rebuild or replace the system on which Windows runs, and that’s outside the scope of this story.

The amount of time and effort required for each step goes up incrementally. Some steps involve additional work to get your PC more or less back to where it was prior to taking that step. Thus, the most important bit of advice I can dispense for those who must venture beyond Step 1 is this: make a complete backup of your system to provide a source for files and settings that might otherwise go missing. Ignore this at your own risk.

Back it up so you don’t lose it!

Any time you make major changes to a Windows system, such as installing a major application suite like Microsoft Office or performing an OS upgrade or repair, it’s a good idea to begin that process with a complete backup. The important thing is to use a backup tool that creates an image backup of your boot/system drive. That allows you to rewrite that drive and restore your system to normal operation should anything go wrong in your changes or repairs. See my article “How to make a Windows 10 or 11 image backup” for instructions.

Step 1: Using DISM and SFC for system repair

It’s now considered a best practice to run DISM before running the System File Checker (SFC). Earlier versions of this story did things in reverse order — but that was before I got direct advice from Microsoft to run DISM first, SFC second. Let me explain…

DISM is the Deployment Image Servicing and Management tool. Built into Windows, it’s a Swiss Army knife for working with Windows OS images, both offline and online. DISM can often fix things that SFC can detect but that it cannot itself fix. DISM supports a raft of capabilities with switches and parameters to match, but basic system file repair syntax is reasonably easy (though it often requires multiple passes before it sets things straight).

You must run DISM in an Administrator: Command Prompt window (press the Windows key + X combination and select Command Prompt (Admin) from the resulting pop-up menu) or in an Administrative PowerShell or Windows Terminal session. Here’s some sample syntax (consult the Microsoft Learn DISM reference for all the gory details):

dism /online /cleanup-image /checkhealth

Typically, when you run this command, the output will show nothing is amiss, as in Figure 1:

Figure 1: DISM can check the health of any Windows image. Here, it reports A-OK for a production PC.
Ed Tittel / IDG

The /checkhealth command simply checks the running image (that’s what /online means) to see if it can detect any damage or corruption. Because it’s only checking file hashes and signatures, this command completes in under a minute on most machines. The good thing about /checkhealth is that it not only tells you if it finds damage but if that damage is repairable or not. If it’s repairable, you can proceed to the /restorehealth option (covered in the following paragraphs); if it’s non-repairable, jump to Step 2.

If DISM reports that component store corruption is found and is repairable, you should attempt repairs. That syntax reads:

dism /online /cleanup-image /restorehealth

Even if errors were detected in the preceding step, this command should complete successfully. It replaces corrupt or questionable elements in the Windows Side-by-Side (WinSxS) store, reading from a local copy of your Windows image files by default.

The /restorehealth command can be tricky to use. Because it actually repairs a Windows image, it needs a source from which to attempt such repairs. You can omit the /source option, but if you do, the command will try to grab its files from Windows Update over the internet. This may or may not work, depending on firewall settings on your network.

A safer bet is to point DISM at a known good source for Windows image components on the local machine (or on your local network). This can be a Windows image (.wim) file or a compressed Windows image (.esd, used for electronic software downloads of Windows installations, as the file extension indicates). You can also point to a separate WinSXS folder (the usual directory path is C:WindowsWinSXS) taken from another PC with similar hardware for which dism … /checkhealth returns no issues.

The syntax for image files is where things can get interesting. To point to the install.wim file that shows up in ISO downloads for the Windows 10 or 11 installer on a USB flash drive designated L:, for example, you must use the following source specification (which uses the first image it finds inside the.wim file, designated:1):

/source:WIM:L:sourcesinstall.wim:1

To use an ESD file, change the wim items to esd, as shown here:

/source:ESD:L:sourcesinstall.esd:1

If you run into difficulties getting this to work, try adding the /limitaccess switch to your command strings. This stops DISM from attempting to grab source files from Windows Update, which it will sometimes do even if pointed at a local source. If you just can’t get either of these to work, try a WinSXS folder instead.

Note: the version and language for the /source image must be identical to that for the image to be repaired. This may mean using UUP Dump, Microsoft’s Media Creation Tool, the Windows Insiders page, or even Visual Studio Subscriptions (subscription required) to grab the correct Windows version/build. See my article “The best places to find Windows ISOs” for details on how to use these sources. It also explains how to create media and mount an ISO file to give DISM the right /source from which to work.

Figure 2 shows typical DISM output using /restorehealth:

Figure 2: Even if /restorehealth doesn’t DO anything, it reports successful completion (unless there’s an error, in which case it may report either failure or success, depending on what happens).
Ed Tittel / IDG

Now it’s time to run SFC, Microsoft’s System File Checker. To quote Microsoft Learn, SFC “scans and verifies the versions of all protected system files.” Thus, it tells you if it finds anything amiss. Enter the command SFC /scannow at an Administrative Command Prompt or Administrative PowerShell session. The command takes a few minutes to complete, depending on your PC hardware. Unlike DISM, SFC scans and makes repairs in one go.

Figure 3 shows sample output when SFC finds files in need of repair. If this occurs on your PC, repeat the SFC /scannow command until you see the clean bill of health shown in Figure 4. This seldom takes more than two or three tries (on the system shown in Figures 3 and 4, it took one repeat only).

Figure 3: When SFC finds errors, it fixes (and logs) them.
Ed Tittel / IDG

Figure 4: Repeat SFC /scannow until you see “did not find any integrity violations.”
Ed Tittel / IDG

In my experience, most problems are solved at this point. Thus, the odds are favorable that you won’t have to continue onto Step 2. But if DISM can’t find your Windows image, or SFC can’t repair your system files, proceed to Step 2.

Step 2: Try a recent image backup

Restoring an image backup works like this: launch the backup/restore software, tell it to restore, choose the image (usually by date and time) to which you’d like to roll back, then initiate the restore procedure. For example, Macrium Reflect, my preferred image backup tool, offers a Restore menu, then allows you to browse stored backup files to pick the one you want in an Explorer-like Open window.

For step-by-step instructions for making and restoring image backups, see my story “How to make a Windows 10 or 11 image backup.”

If reverting to an image backup doesn’t work (or you don’t have one), it’s time to move on to Step 3.

Step 3: In-place upgrade to current Windows version

For Windows 10 or 11, this technique essentially involves overwriting the current OS installation with a fresh new copy while leaving data files, settings, and preferences alone. That means running the Windows 10 or 11 installer for the same version/build currently running on the machine from inside Windows itself. As you will learn at the end of this section, this is markedly easier for Windows 11 than it is for Windows 10.

Performing an in-place upgrade in Windows 10

To accomplish this for Windows 10, you’ll need installation media for the same edition (Home, Pro, Enterprise, or Education), language (en-US for American English, for example), and build as the currently installed edition. Bittedness must also be identical: 32-bit media for a 32-bit install, 64-bit media for a 64-bit install. (See “The best places to find Windows ISOs” for info on obtaining the correct Windows version/build from UUP Dump, or the Media Creation tool, or other sources. I recommend building an installable and bootable USB flash drive for this purpose; you may need it again sometime.

Before launching into this process, be sure to log in to Windows 10 with an administrative account. Most experts recommend that you disable or uninstall any third-party antivirus or security software (anything other than Windows Defender, in other words) and turn off Fast Boot and Secure Boot in your UEFI firmware settings (if turned on). You can reinstate these items when the in-place upgrade is complete.

Performing an in-place upgrade is easy. Run setup.exe from the USB flash drive, or from the mounted ISO, which should reside on some drive other than the system/boot device. The Windows installer will do the rest and will guide you through the installation process. On the “Ready to install” screen, be sure both “Install Windows 10” and “Keep personal files and apps” are checked. The second checkmark is particularly important, because that tells you it’s indeed an upgrade install, and leaves non-OS files and settings (mostly) alone.

The whole process takes 10 to 30 minutes, depending on your PC’s hardware. You’ll need to reestablish your network connection and set your time zone (unless you live in the Pacific time zone where Microsoft has its HQ). For more detailed instructions, including a list of cleanup tasks to perform after the in-place install, see “How to fix Windows 10 with an in-place upgrade install.”

Performing an in-place upgrade in Windows 11

If you’re running Windows 11 and want to perform an in-place upgrade install, that process is dead easy. Click Start > Settings > System > Recovery (four clicks). As shown in Figure 5, you need to click only the Reinstall now button under the “Fix problems using Windows Update” heading to make this happen.

Figure 5: Once you navigate to this screen, click the “Reinstall now” button. Done!
Ed Tittel / IDG

Windows Update does the rest: it downloads all the necessary files and builds a compatible repair image, no additional effort required. IMO, it’s one of the best new features in Windows 11 (and a good reason to upgrade, for those in need of one).

Step 4: Completely reinstall Windows

If none of the previous steps has fixed Windows, it’s time for a do-over. In this step, you can choose one of two different options for completely reinstalling Windows on your machine — a more draconian approach to restoring operations than any of the previous steps. Whichever method you choose, you’re going to have to reinstall all apps and applications.

Option A: Reset this PC

This repair method rolls your PC back to its built-in recovery image (usually established when the unit gets its initial Windows image and the original system/boot disk layout is established) or a fresh, clean Windows image downloaded from Microsoft’s servers. For something with the ability to change your PC so thoroughly and completely, it’s surprisingly easy to do from an administrative account.

Go to Settings > Update & Security > Recovery, and then click the Get started button under “Reset this PC,” as shown in Figure 6 for Windows 10. (You can see this same facility for Windows 11 at the bottom of Figure 5. Click Reset PC to start the process there.)

Figure 6: Reset this PC rolls Windows back to its original as-delivered state.
Ed Tittel / IDG

The next screen that appears (Figure 7) tells you what’s coming. It also emphasizes that the impact of a reset operation is both major and sweeping.

Figure 7: This is a confirmation that gives you a last chance to bail out. Otherwise, you’re in for a long process even if you elect “Keep my files.” “Remove everything” does exactly what it says.
Ed Tittel / IDG

Understand what this means: if you reset, you lose all applications and apps installed after the OS made its initial debut. You can decide whether or not to keep what Microsoft calls your “personal files” (everything in Documents, Downloads, Pictures, Music, and Videos), but everything else goes.

If you proceed with the reset, you’re presented with two options: “Cloud download” grabs fresh, new Windows installation files from Microsoft’s servers, while “Local reinstall” uses your PC’s built-in recovery image. Unless you have connectivity restraints, I recommend the cloud download option to ensure that any issues with your PC’s recovery image won’t carry through to the new installation.

For more details about using Reset this PC, see “Windows 10 recovery, revisited: The new way to perform a clean install.”

Reset this PC is convenient and requires no supplementary media, but I prefer a more traditional approach: performing a clean Windows installation from a bootable USB drive or mounted ISO, covered next.

Option B: Clean install of Windows from installation media or mounted ISO

This option means starting over with a completely new OS installation. Why might this be necessary? Aside from reasons such as incurable system instability, malware infestation, or problems that take longer to fix than the time is worth, it may be desirable to switch from legacy BIOS emulation to using available UEFI. It might also be desirable to wipe the boot/system drive clean to remove leftover items (recovery partitions, OEM partitions, and so forth) from older Windows versions and let Windows start over with a clean slate.

The good news is that as long as you’ve got a valid Windows 10 or 11 key or have activated your installation with Microsoft’s Activation servers, Microsoft will recognize your PC and permit it to activate itself without requiring you to supply a valid key. Nevertheless, if you’ve got access to the key, it’s a good idea to put that file on a USB drive or some other storage media just in case it’s requested. This seldom happens, but should it be needed, it’s good to have. (There are great tutorials at TenForums and ElevenForum about how to find and record your Windows 10 and keys, respectively.)

You can check your activation status by typing activ into the Settings search bar, then choosing “Activation settings” in the resulting list. As you can see in Figures 8 and 9, if the Activation pane says “Windows is activated with a digital license…” (Windows 10) or “Active” (Windows 11), you should be OK.

Figure 8: If Windows 10 is activated with a digital license, you should be able to reinstall without subsequent activation problems. If they do pop up, call +1-800-426-9400 in the US to fix things.
Ed Tittel / IDG

Figure 9: The Windows 11 activation is terser but no less informative. The same phone number as in Figure 8 works here, too, if you have problems to resolve.
Ed Tittel / IDG

The process for performing a clean install is 99% the same as that for the in-place upgrade from Step 3. Just boot from your installation USB flash drive, select Install Now, accept the license terms, and pick the Custom: Install Windows only (advanced) option when it’s presented to you. The rest of the details — and there are many — are all nicely covered in the TenForums and ElevenForum tutorials on this subject.

After the installation

Once you complete either the Reset this PC or the “clean install from installation media or mounted ISO” process, you’ll be starting over from scratch. For me, that means reinstalling Office plus all the apps and utilities that I customarily use on a production machine. It usually takes me 8 to 12 hours to work all the way through that process manually.

To speed the process along, I recommend using either the PatchMyPC Home Updater or Ninite utility, or using the WinGet command to import an already-exported configuration file.

Picking up the pieces after the repair

Hopefully, you’ll never have to venture further than Step 2 in this list. But if you must dig deeper than that, remember to clean up after it’s all over. That means running Disk Cleanup (or some third-party alternative) and making sure all your applications are installed and working. It also means making another backup when you’ve got things the way you want them, so you’ll have it at your disposal should things go south again.

In the meantime, enjoy your repaired and rejuvenated Windows system!

This article was originally published in June 2016 and most recently updated in July 2024.
https://www.computerworld.com/article/1674590/repair-windows-10-and-11-step-by-step-guide.html

Related News

News copyright owned by their original publishers | Copyright © 2004 - 2024 Zicos / 440Network
Current Date
Nov, Tue 5 - 07:38 CET