DISM error 0x800f081f "The source files could not be found": give Windows a matching source
Fix DISM /RestoreHealth error 0x800f081f "The source files could not be found": point it at a matching install.wim, allow Windows Update, and repair with SFC afterwards.
by OhSudo ·
C:\> DISM /Online /Cleanup-Image /RestoreHealth
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.DISM repairs Windows by replacing damaged system files with good copies. This error means it couldn’t find good copies: not on this machine, and not from Windows Update.
It’s nearly always one of two things. The machine can’t use Windows Update, as is common on servers behind WSUS. Or the source you gave it doesn’t match your exact Windows build.
TL;DR
Mount an ISO of the same version and build, and use it as the source:
Mount-DiskImage -ImagePath "C:\ISO\windows.iso"Get-WindowsImage -ImagePath "E:\sources\install.wim"DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:E:\sources\install.wim:1 /LimitAccesssfc /scannowThe number after the path is the edition’s index, from the second command.
1. Look at the state first
DISM /Online /Cleanup-Image /CheckHealthDISM /Online /Cleanup-Image /ScanHealthCheckHealth is quick, and ScanHealth takes a while. The details are in C:\Windows\Logs\DISM\dism.log, and in C:\Windows\Logs\CBS\CBS.log, where the failing package is usually named.
2. Try Windows Update
With no /Source, DISM downloads from Windows Update. On a machine pointed at WSUS, that often fails, because WSUS usually doesn’t hold those repair files. You can allow the direct route with a policy: Computer Configuration → Administrative Templates → System → “Specify settings for optional component installation and component repair”, and enable Download repair content … directly from Windows Update.
The same setting in the registry, for a quick test:
$key = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Servicing'New-Item -Path $key -Force | Out-NullSet-ItemProperty -Path $key -Name RepairContentServerSource -Value 2 -Type DWordgpupdate /forceThen run /RestoreHealth again. Undo it afterwards if you manage this by policy.
3. Use an ISO that matches
Find your exact version:
winverGet-ComputerInfo -Property WindowsProductName, OsBuildNumber, OsHardwareAbstractionLayer(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').DisplayVersionGet an ISO of that version in the same language and architecture, and mount it. Windows assigns a drive letter, E: in these examples. Installation media has one of two files:
sources\install.wim: usewim:sources\install.esd: useesd:
Find the index of your edition:
Get-WindowsImage -ImagePath "E:\sources\install.wim" | Format-Table ImageIndex, ImageNameDISM /Online /Cleanup-Image /RestoreHealth /Source:wim:E:\sources\install.wim:3 /LimitAccess/LimitAccess keeps DISM off Windows Update, so you see whether this source works by itself.
The prefix matters. Without it, DISM treats the path as a folder and doesn’t read the file, and you get the same error.
4. Still failing: the source is too old
An ISO from the release date doesn’t contain the fixes installed since, so the files DISM wants may not be in it. Two ways out:
Get a newer ISO. Current media from Microsoft includes recent updates.
Update the machine first. Install the latest cumulative update, by hand from the Microsoft Update Catalog if Windows Update is broken. Then try again, using the newer ISO if you have one.
Also, a known source of this is a failed update stuck in a pending state. See whether anything is waiting, and if so, restart first:
DISM /Online /Get-Packages /Format:Table | Select-String 'Pending|Staged'5. The feature case
The same error appears when installing a feature that was removed from disk, with .NET Framework 3.5 being the classic:
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /Source:E:\sources\sxs /LimitAccessThe source here is the sources\sxs folder, with no wim: prefix. Or with PowerShell:
Install-WindowsFeature NET-Framework-Core -Source E:\sources\sxs6. Then run SFC
DISM repairs the image, and sfc uses that to repair your running system. So the order is DISM, then SFC:
sfc /scannow| SFC says | Means |
|---|---|
did not find any integrity violations |
Good |
found corrupt files and successfully repaired them |
Good, and restart |
found corrupt files but was unable to fix some of them |
Run DISM again, then see C:\Windows\Logs\CBS\CBS.log |
If repairs keep failing and you’ve tried a fresh, matching ISO, an in-place upgrade from that ISO reinstalls Windows while keeping apps and data. Take a backup first. If the disk itself is failing, repair won’t last: run chkdsk C: /scan.
Warning
Don’t copy install.wim or system files from an arbitrary download. Use media from Microsoft (or your Volume Licensing portal), as these are the files your system will trust from then on.
Shell, we have a problem!
Similar, but different: 0x800f0954 often appears when Features on Demand can’t reach Windows Update because of WSUS, and the policy in section 2 is the usual fix. 0x800f0906 means the files couldn’t be downloaded. Error 87 means a mistake in the command, usually a missing space before a /. An update that fails with 0x80070643 is often repaired with the same DISM command. And if a remote machine won’t answer at all, see The RPC server is unavailable. Can’t delete a system folder? See permission from TrustedInstaller.
Found this useful? Share it.
Found a mistake? Let us know at contact@ohsudo.com.