Using DISM with /source

I've used DISM many times, but have never been able to get the /source option to work.  I've an immediate example to illustrate it.

I have a Windows 10 computer that won't boot in standard mode, though it will in Safe Mode.  I've done a number of things to try to resolve it without success and am trying to use DISM.

My first attempt was to use the following from an elevated prompt (in Safe Mode):
dism /online /cleanup-image /restorehealth
It gets to 97% and then exits with an error 0x800f0906 and a message: The source files could not be downloaded.
It includes more info about how I should use the /sources switch.
I'm presuming that this means the recovery files are not intact so I need to provide a new set.

I grabbed a Win 10 ISO and copied it to the computer.  I mounted it to drive e: and ran the following:
dism /get-wiminfo /wimfile:e:\sources\install.wim
It responded that it was version 10.0.14393.0

I then tried to use this source by typing:
dism /online /cleanup-image /restorehealth /source:e:\sources\install.wim
It responded with:
Version: 10.0.14393.0

Image Version: 10.0.14393.0
It then ran to 97% and gave me the same error number and message as before.
I take it from the Version and Image Version display that the installed Win 10 and the source Win 10 that I'm trying to use are the same version.

I tried extracting the files from the ISO and pointing to that folder but got the same results.

This is typical of what I've run into when trying to use /source.  Clearly I'm missing something about how to use the /source switch on DISM.  Any help to point me to what it is would be greatly appreciated.
LVL 24
CompProbSolvAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nobusCommented:
look here for more info  - i had also troubles :  https://www.experts-exchange.com/questions/29061891/windows-10-repair-fails.html#a42375791
here the command i ran ( and checked - it works ok) :
Dism /image:e: /Cleanup-Image /RestoreHealth /Source:wim:D:\sources\install.wim:1 /limitaccess

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CompProbSolvAuthor Commented:
Thanks for the input.

You have /image:e: in the command line.  I'm assuming that this means you are booting from something other than the drive you're trying to repair.  Are you booting with a Win installer (DVD or USB) or are you booting from a full installation of Windows and accessing the drive to repair as a secondary drive?
CompProbSolvAuthor Commented:
Also.... is there a way to use /sources successfully when running DISM on the computer I'm trying to fix (/online)?
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

McKnifeCommented:
Just add the /limitaccess to your command.
CompProbSolvAuthor Commented:
As I read the docs for /limitaccess I don't see how it should change things.  The docs say that when DISM looks for the source files, it will first look for where /source: points, then where the GPO points, and then online.  /limitaccess just eliminates the online part.  Am I reading this wrong?

In any case, I added /limitaccess and it didn't change the result.



I moved the drive to a Win 10 computer as the second drive.  I then ran the following from an elevated prompt:
dism /image:j: /cleanup-image /restorehealth /source:wim:j:\win10\sources\install.wim:1 /limitaccess
I get an error: 2  Unable to access the image.

j:\windows is where the windows files are on the drive I'm trying to fix.  j:\win10 has the files extracted from the Win 10 ISO.  I have no problem browsing j:\windows.

I tried using /image:j:\windows but that gave the same results.

It's a bit difficult to sort out from the documentation, but is /image used only on an installation image or one that is already a working Windows installation?
nobusCommented:
yes, i booted from USB e: is the drive to repair
McKnifeCommented:
"The source files could not be downloaded" meant, it is trying to download them from microsoft, online. That's why /limitaccess should have made a difference. Since it has not, we have to make sure that you did anything correctly. We used that very command and it worked without even having online access. I wonder what is going on.

However, without losing much time, you could do a repair installation, which is more thorough than dism: https://www.tenforums.com/.../16397-repair-install-windows-10-place-upgrade.html
CompProbSolvAuthor Commented:
I'd have done a repair install but, as is stated in the link: "You will not be able to do a repair install at boot or in Safe Mode".
McKnifeCommented:
oh, my bad, I forgot that you are in safe mode.
Please quote the command you used again, was it
Dism /online /Cleanup-Image /RestoreHealth /Source:wim:e:\sources\install.wim:1 /limitaccess
McKnifeCommented:
Please also note that your setup disk would need to match your windows version. The windows version is 14393 (=1607, aka "anniversary update") - do you have the ISO for that or did you try with the newest ISO (1709)? The newest will not work here.
nobusCommented:
>>   The newest will not work here.   <<  i guess MS is creating a catch 22 issue here
if you try to repair it with an other version - it does not work, but often you don't know the actual version
i suggest they correct it so it works on all versions - when using the latest download
CompProbSolvAuthor Commented:
I spent some more time on this and have some updates, but still no success.

To start with, I had the wrong version of Windows 10 to use as a source.  When I did the /get-wiminfo command, I didn't add an index.  The only version number mentioned in the output was the one I wanted (10.0.14393.0), but that was actually reporting the version of DISM.  The source I was using was an older version.

I found another installer that I had that I had labeled as 1607.  I copied the ISO to the problem computer and mounted it.  I checked the version with:
dism /get-wiminfo /wimfile:f:\sources\install.wim:2
and received a longer report which included the version number 10.0.14393.0 which is consistent with what Winver says.

I used the :2 index as :1 on this file is for Win 10 Pro and :2 is for Home.  The existing installation is Home.

With the ISO mounted as f: I've tried the following commands:
dism /online /cleanup-image /restorehealth /source:f:\sources\install.wim /limitaccess
dism /online /cleanup-image /restorehealth /source:wim:f:\sources\install.wim /limitaccess
dism /online /cleanup-image /restorehealth /source:f:\sources\install.wim:2 /limitaccess
dism /online /cleanup-image /restorehealth /source:wim:f:\sources\install.wim:2 /limitaccess

They ALL give me the error message that the source files could not be found.

I have some basic questions about the syntax for /source as clearly I'm missing something here:

1)  When using /online and /source, is source expecting to point at a .wim file or at a working installation of Windows?
2)  If I point /sources at a .wim file, do I add "wim:" after "/sources:"?
McKnifeCommented:
I'd expect it to work and have no explanation for "file not found".
nobusCommented:
as you can see from my Q - i was never able to find a solution, even with McKnife's help  - another thank you McKnife!
CompProbSolvAuthor Commented:
I never was successful at using the /source: option.  I'll try again someday with the actual source files that were used to install a test OS.  I'm still unclear on which is the correct syntax.

Thanks to all for your suggestions!
CompProbSolvAuthor Commented:
Though I didn't get it resolved, these answers may well be helpful in the future or to others.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 10

From novice to tech pro — start learning today.