1

I have a Windows 10 machine that does not boot into Windows, not even Safe Mode, after a reboot following a Windows Update and which none of the standard Windows repair options, or SFC /SCANNOW, are able to fix, hence I am falling back to DISM.

I have a USB stick containing a Windows 10 Pro ISO for 19043.985 amd64 (which is what DISM reports the image as being), created via uupdump.net:

enter image description here

...within which there is a WIM install file, but DISM is never able to find replacements for any of the corrupt entries when executed from the Win PE command console:

X:\Sources>dism /Image:c:\ /Cleanup-Image /RestoreHealth /LimitAccess /Source:e:\sources /Scratchdir:c:\temp

Deployment Image Servicing and Management tool Version: 10.0.19041.1

Image Version: 10.0.19043.985

[==========================100.0%==========================] Error: 0x800f081f

The source files could not be found. Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see https://go.microsoft.com/fwlink/?LinkId=243077.

I have read How to execute DISM from Windows 10 PE on Win 10 system with Windows Update / Microsoft as source only? and Windows 10 DISM cannot find files, even with ISO mounted but have been unable to find any clues.

The whole DISM log file can be found here; it seems that it is at least loading the source from USB:

2024-02-18 09:44:02, Info                  CBS    Exec: Addsource called, Session: 672_2522140, Client: DISM Package Manager Provider, from GPO: No, Path: e:\sources
2024-02-18 09:44:02, Info                  DISM   DISM Package Manager: PID=672 TID=948 CBS session options=0x20000! - CDISMPackageManager::Internal_Finalize
2024-02-18 09:44:02, Info                  CBS    Client specifies manual store corruption detect or repair.

What might I be doing wrong?

Rob
  • 153
  • 1
    /Source: has to either be a ESD/WIM with index specified, an offline Windows image (e.g. a non-booted to Windows OS that's not the one being fixed - Windows is referred to as an "image" when servicing), or a Component Store [Windows\WinSxS], all of which must match the version of the offline image attempting to be repaired. Please see this answer for how to do so. Also, normally /Image: must be <partition>:\Windows, and C: is usually never the Windows partition in WinPE/WinRE - to ascertain: DiskPartlis volexit – JW0914 Feb 18 '24 at 15:19
  • (Cont'd...) The install.<esd|wim> on an Install USB is located at sources/install.<esd|wim> – JW0914 Feb 18 '24 at 15:21
  • Unfortunately if I change to /Source:wim:e:\sources\install.wim:1 (having verified that Windows Pro is at index 1) the log says Cannot add wim: file source because it is not supported during offline servicing. – Rob Feb 18 '24 at 16:27
  • 1
    Have you tried mounting index 1 and using <mountpoint>\Windows\WinSxS as the source? Create a directory for the mount directory, then Dism /Mount-Image /ImageFile:e:\sources\install.wim /Index:1 /MountDir:<mountpoint>\mount /ReadOnly, using <mountpount\mount\Windows or <mountpount\mount\Windows\WinSxS as the source, and if that doesn't work, try copying out Windows\WinSxS, then using the new path to it as the source. – JW0914 Feb 18 '24 at 17:04
  • Have you tried running Sfc without running Dism first? Sfc /ScanNow /OffBootDir=<OSpartition>:\ /OffWinDir=<OSpartition>:\Windows. That will check and replace any OS files that are corrupted - /RestoreHealth should be run first since Sfc assumes there's no corruption in the Component Store, however this isn't the first time I've come across issues getting /RestoreHealth to work in WinPE with the /Source specified – JW0914 Feb 18 '24 at 17:15
  • Mounting seems to have got me further: the payload corruption has been repaired! Manifests remain corrupted though. I did try running SFC with that command-line originally, though I used C:\Windows - what is the syntax to specify a partition instead of a drive letter? – Rob Feb 18 '24 at 17:18
  • 1
    You'd always specifiy the drive letter of the OS partition - to ascertain: DiskPartlis volexit (C: is rarely the OS partition in WinPE since drive letters in WinPE are assigned in numerical order of the HDD0, partitions 1 - x, HDD1, partitions 1 - x, etc. and the OS partition will always be at least the second partition and therefor never assigned C:) – JW0914 Feb 18 '24 at 17:19
  • OK, so C is correct for me. With payload corruption fixed and only manifest corruption remaining I tried sfc /ScanNow /OffBootDir=c:\ /OffWinDir=c:\Windows once more and it said it succeeded but I've now managed to get into a state where I can only boot with the USB drive still connected, presumably because I failed to unmount it? Neither dism /Cleanup-Mountpoints nor dism /Cleanup-wim has fixed it. – Rob Feb 18 '24 at 17:58

1 Answers1

2

Since DISM offline did not fix the problem (DISM is not the best repair tool for your issue here - Windows OS highly damaged), you need to try the Windows 10 Startup Repair.

First get the manufacturer's Hardware Diagnostic App and test for hardware errors.

If there are no apparent hardware errors, try doing the Windows !0 Startup Repair.

Startup Repair

Start the system to the installation media for the installed version of Windows. For more information, see Create installation media for Windows.

On the Install Windows screen, select Next > Repair your computer.

On the Choose an option screen, select Troubleshoot.

On the Advanced options screen, select Startup Repair.

After Startup Repair, select Shutdown, then turn on your PC to see if Windows can boot properly.

If Startup Repair fails, then back up your system (drive in carrier) and do a fresh install of Windows.

John
  • 49,923
  • Yes, startup repair fails I'm afraid, that's how I got here. Looking at the damaged packages, they are mostly 19041.985, so I created an ISO of that from uupdump.net but, when looking inside the install.wim it created, all of the package versions are 19041.1, no sign of a 19041.985, so it looks like I will not be able to obtain the missing packages that way anyway. – Rob Feb 18 '24 at 14:32
  • Ref. HW, there was a HD issue, I've replaced it and image-copied the old to the new, and was hoping I could repair the packages on the new HW. – Rob Feb 18 '24 at 14:33
  • You will need the Startup Repair as just getting the good packages (DISM) will not likely fix things – John Feb 18 '24 at 14:39
  • Hokay, looks like I'll have to fresh install then (user data is already backed up several ways to Sunday). – Rob Feb 18 '24 at 14:40
  • 2
    "Since DISM offline did not fix the problem" - the command the OP used is incorrect. "...DISM is not a strong repair tool for your issue here" - Dism and Sfc will repair all Windows system files if something became corrupted during a Windows Update – JW0914 Feb 18 '24 at 15:17
  • if something became corrupted during a Windows Update: though the problem occurred at a reboot after a Windows update the HDD quick diagnostic did also fail so I can't be sure as to the source of the failure. Calling dsim with /StartComponentCleanup returns successfully. I'm using an ISO for the repair and that seems to be accepted as a source if I do /Source:e:\sources but if I do /Source:wim:e:\sources\install.wim:1 (having verified that Windows Pro is at index 1) the log says Cannot add wim: file source because it is not supported during offline servicing. – Rob Feb 18 '24 at 15:54
  • @Rob That seems like a hardware issue, less so an issue with the OS files becoming corrupted. /Source has to be a location containing the Component Store and .\sources\sxs only contains packages for the WinPE files, specifically for networking in WinPE. In order to repair an offline image, the full Component Store contained within Windows\WinSxS must be used - it can be copied out of an image of the same version, or an online Windows OS of the same version, and stored anywhere. The Component Store contains backups of all system files, which is what Sfc then uses to check for corruption – JW0914 Feb 18 '24 at 17:12
  • For everyone's benefit, with the approach to dsim as directed by @JW0914, specifically mounting the recovery files on the USB containing the exact Windows version using dism /Mount-Image /ImageFile:e:\sources\install.wim /Index:1 /MountDir:<mountpoint>\mount /ReadOnly, and then having /Source=<mountpount\mount\Windows\WinSxS, that fixed the payload corruption, allowing a subsequent sfc /ScanNow /OffBootDir=c:\ /OffWinDir=c:\Windows to fix the remaining manifest corruption. However, even with ZERO problems I still got a "Windows cannot start" blue screen, hence accepting this answer. – Rob Feb 19 '24 at 00:00
  • @Rob Issue the following commands in WinPE: BootRec /FixMBR && BootRec /FixBoot && BootRec /RebuildBCD (if UEFI, remove && BootRec /FixBoot, as EFI boot files have to be rebuilt using BCDboot after mounting the EFI partition). Once done, even if it finds 0 Windows installations, reboot and it should boot; if it doesn't, this answer's solution to do a fresh install would be recommended. If you can get it to boot, I would also recommend doing a repair install (running Windows' setup.exe while booted to Windows, choosing to keep all files) – JW0914 Feb 19 '24 at 00:49
  • I did try those a few times but since, when told to "continue to Windows" from the repair screen, I still ended up with the same blue-screen-of-not-continuing, I decided that the original problem must have somehow mangled Windows in a way that now sfc/ dism is unable to fix. I will feel safer with a reinstall. Thanks very much for all your excellent/precise help though, very useful indeed. – Rob Feb 19 '24 at 08:53