FIX: DISM Error 50, DISM does not support servicing Windows PE with the /Online option (Solved)
This tutorial contains instructions to resolve the following error when running the DISM command "Dism.exe /Online /Cleanup-Image /Restorehealth" from the Windows Recovery Environment: "Error 50, DISM does not support servicing Windows PE with the /Online option".
The above error is occurred, because in WinRE the operating system is not running, so the /Online switch is useless at this case. In fact the /Online switch in DISM tool, specifies that the action is to be taken on the operating system that is currently running.
How to fix: Error 50 DISM does not support servicing Windows PE with the /Online option. (Windows 10)
1. After booting your computer from the Windows 10 installation media, press SHIFT + F10 keys at the first install screen to launch Command Prompt.
2. Inside the WinRE command prompt window, get a list of all available drives, by giving this command:
- wmic logicaldisk get name
3. Then find out which drive contains the "Windows" folder, by typing this command: *
- dir drive-letter:
* e.g. To see the contents of the C: drive, type: "dir C:" (without quotes). If you cannot see the "Windows" folder on the C: drive, then continue to the next drive (e.g. "dir D:", "dir E:", etc.), until see the "Windows" folder.
[As you can see at the screenshot below, the Windows folder (at this case) is located at the D: drive.]
4. Once you find the "Windows" drive (e.g. the "D" in this example), give this command to repair the offline Windows image:
- dism.exe /Image:D:\ /Cleanup-Image /Restorehealth
* Notes:
1. Where D = the Windows drive. (Change it according your situation)
2. There is space between \ / ("…/Image:D:\ /Cleanup-Image…")
3. If after executing the above command, you receive the "Error 0x800f081f: The source files could not be found", then perform a repair upgrade. To do that: **
a. Boot from the Windows 10 installation media.
b. At Windows Setup wizard, press 'Next' and then click 'Install Now'.
c. Accept the 'License agreement'.
d. When asked, select Upgrade: Install Windows and keep files, settings, and applications.** If you able to start your Windows 10 in Safe Mode with networking , then run the following command (in Admin Command Prompt):
- DISM /Online /Cleanup-Image /RestoreHealth
5. When the DISM operation is completed, give the following SFC command to complete the repairs. *
- SFC /SCANNOW /OFFBOOTDIR=D:\ /OFFWINDIR=D:\Windows
* Notes:
1. Where D = the Windows drive. (Change it according your situation).
2. There is space between \ / ("…/OFFBOOTDIR=D:\ /OFFWINDIR…")
6. When the operation is completed, reboot your computer.
Did it work for you?
Please leave a comment in the comment section below or even better: like and share this blog post in the social networks to help spread the word about this solution.
Pete
October 5, 2018 @ 3:16 pm
Thank you, thank you, thank you! So many DISM instructions assume you are using it from within windows, this was the first tutorial I found telling me what to do from the repair environment. After following the instructions, I rebooted but still got the RE, so thought it hadn't worked (even though it told me it had repaired files) so I tried a system restore which also failed. Rebooted after that and all came up good. Not sure quite what was going on, but certain it was thanks to you.
Ryan Bartlett
February 10, 2019 @ 3:40 am
Typed in
Dism.exe /image:C:\ /cleanup-image /restorehealth
Got
Error: 2
Unable to access image. Make sure that the image path and the Windows directory for the image exist and you have the Read permissions in the folder.
The DISM log file can be found at X:\windows\Logs\DISM\dism.log
How do i fix this?
Lakonst2013
February 11, 2019 @ 12:16 pm
Ryan Bartlett: I suppose that the Windows Drive letter is not the C: but another letter..
real tech
February 12, 2019 @ 11:54 am
Read point 2 again
Randy
February 15, 2019 @ 10:10 am
I have run this command twice so far and both times I have received the following:
"Error: 1016
An error occurred whle attempting to access the image.
For more information, review the log file.
The DISM log file can be found a X:\windows\Logs\DISM\dism.log"
From this error message I am presuming that the repair did not work. I would review the DISM log file, but I am sure that I would not know what to do with the information I saw there.
Even so, I am grateful for the attempt. I feel like your instructions got me closer to saving the information on my hard drive than any others out there so far. Thanks for your straightforward and clear instructions.
Lakonst2013
February 15, 2019 @ 12:05 pm
Randy: I think you enter a wrong drive letter in the SFC command. Please try the following and tell me the resultts:
1. In (WinRE) Command prompt type bcdedit and press enter.
2. Look in which partition you see "systemroot ——>\WINDOWS".
3. Then look above that line to find out the drive letter (e.g. "osdevice —-> partition=D:").
4. Finally give the "SFC /SCANNOW /OFFBOOTDIR=X:\ /OFFWINDIR=X:\Windows" command but replace the "X" letter with the letter at 'osdevice' line (e.g. "D").
Randy
February 15, 2019 @ 8:11 pm
Lakonst, I hope I'm not reposting. I responded but it looks like my last comment got lost.
I followed the original instructions and discovered that the "Windows" folder is on drive "C" in my laptop. I ran "bcdedit" and confirmed that information.
I wish it was something as simple as the Windows folder just being on a different drive, but, sadly, that's not the case. Any other ideas? Thanks.
Lakonst2013
February 16, 2019 @ 9:02 am
Randy,
1. Give the following command in WinRE command prompt:
DISM /Image:C:\ /Get-Packages
2. If you receive the same error ("An error occurred while attempting to access the image"), then try to restore the registry with this command:
copy C:\Windows\System32\config\RegBack\*.* C:\Windows\System32\config
3. Then again give: DISM /Image:C:\ /Get-Packages
4. If the output is a list of the installed packages, restart and try to boot the PC normally and if you cannot boot give the below command to fix the image:
dism.exe /Image:C:\ /Cleanup-Image /Restorehealth
Randy
February 15, 2019 @ 6:31 pm
Lakonst, I did follow the earlier instructions that told how to find which drive to address. Those instructions told me that the "Windows" folder was on drive C.
When I run "bcdedit" it says, in the line above systemroot: "partition=C," so I'm pretty sure I'm typing the correct drive letter.
Any other ideas?
Thanks!
Venky
April 10, 2019 @ 9:41 am
The same error I received.. Then what I did is I put a space between Image:C:\ /Cleanup-Image….. "C: \ /cleanup-image"
That sloved my problem
Andrew
November 23, 2019 @ 9:10 pm
Cool, this space fix works!!
Author could you please fix this in your article?
Randy
February 15, 2019 @ 7:47 pm
Lakonst, I hope I'm not reposting. I responded but it looks like my comment got lost.
I followed the original instructions and discovered that the "Windows" folder is on drive "C" in my laptop. I ran "bcdedit" and confirmed that information.
I wish it was something as simple as the Windows folder just being on a different drive, but, sadly, that's not the case. Any other ideas? Thanks.
rcb
March 21, 2019 @ 4:47 pm
dism.exe /Image:D:\ /Cleanup-Image /Restorehealth
usually windows is in drive C:
dism.exe /Image:C:\ /Cleanup-Image /Restorehealth
dont forget the space between \ & /
a message appeared that the scratch directory size might be insufficient, but the process went on
still waiting for results while typing this message
Lakonst2013
March 21, 2019 @ 5:42 pm
rcb: Assuming that the Windows drive is the drive "D:":
1. Give the following command to create a scratch directory: mkdir D:\Scratch
2. Then type the DISM command as follows: dism.exe /Image:D:\ /ScratchDir:D:\Scratch /Cleanup-Image /Restorehealth
Tamal Samaddar
August 28, 2019 @ 1:07 am
I typed exactly as you mentioned.. and received the error:3 "the system cannot find the path specified" "An error occurred closing a servicing component in the image" .. what can be done now..
Lakonst2013
August 28, 2019 @ 12:41 pm
Tamal Samaddar: Do not leave out the space between \ /
Tamal Samaddar
August 28, 2019 @ 3:34 pm
I didn't leave out the gap sir… I typed exactly as you instructed.. created the scratch dir and even after that when i eun the /restorehealth command i recieve "Error: 3" "The system cannot find the path specified" "An error occurred closing a servicing component in the image" "Wait a few minutes and try running the command again" Please tell me what else can be done..
Lakonst2013
August 29, 2019 @ 11:39 am
Make sure that you boot your system with a Windows Installation media with the same Windows 10 edition & architecture as the installed OS.
arbenek
April 18, 2019 @ 9:43 am
What a wonderful solution! Thank you so much…
Marcos Silva
April 28, 2019 @ 8:54 pm
After 2 days trying other alternatives, this solution worked fine for me. Thanks a lot!
Kamran
May 20, 2019 @ 11:46 pm
HI ,
I am getting error while running first command
dism.exe /Image:D:\ /Cleanup-Image /RestoreHealth
Error : 87
the restorehealth option in not recognized in this context.
Lakonst2013
August 31, 2019 @ 10:57 am
Kamran: What OS you have? The instructions are only for Windows 10.
Yannick
June 25, 2019 @ 2:43 pm
Hello I hope you still respond to these comments. I’ve done everything correctly, even created a scratch directory. But when the DISM hits 84.2% it gives me the “source file could not be found” error 0x800f081f. When googling this error I only get solutions that work when running DISM in Online not in WinRE… Could you help me with this? I can only boot my pc in safe mode otherwise it shows green horizontal bars and crashes (blackscreen) when loading windows..
thanks in advance
Lakonst2013
August 31, 2019 @ 11:28 am
@Yannick: If you able to start Windows in Safe Mode with Networking then open and administrative command prompt and run this command:
DISM /Online /Cleanup-Image /RestoreHealth
Danielle Wright
July 7, 2019 @ 3:04 pm
You are a life saver! I had spent hours trying to fix my computer. I stumbled upon your suggestion and it worked. Thank you!
Snir Amira
July 12, 2019 @ 12:02 am
i have error number 605 what should i do???????
Lakonst2013
July 13, 2019 @ 1:05 pm
Snir Amira: Repair Windows 10 by following the instructions from this article: https://www.repairwin.com/repair-reinstall-windows-10/
Jimy
July 18, 2019 @ 2:25 pm
Error 0xc0000135
Error al intentar iniciar el proceso de servicio para la imagen ubicada en D:/
Lakonst2013
August 31, 2019 @ 10:44 am
Jimy: To fix the problem, try the following:
1. Make sure that the Windows folder exists at drive D:\ .
2. Re-download and re-create the Windows installation media.
3. If you not able to fix the problem, then perform a Windows 10 repair upgrade. to do that:
a. boot from the Windows USB media.
b. At Windows Setup wizard, press 'Next' and then click 'Install Now'.
c. Accept the 'License agreement'.
d. When asked, select Upgrade: Install Windows and keep files, settings, and applications.
julie c boyce
July 28, 2019 @ 11:13 am
This blog was fantastic! I followed everything. You guys know what your talking about. Everything was exactly as it played out. Thanks for unknowingly helping!!
Wendy
August 7, 2019 @ 12:41 am
Hey Lakonst – went through all of the processes in this thread – no go – also did the scratch directory – still getting an error – 23 – An initialization error occurred… any ideas? thanks!
Lakonst2013
August 31, 2019 @ 10:31 am
If the 'Windows' folder is on drive D:\, then:
1. Run this command: DISM /Image:D:\ /ScratchDir:D:\Scratch /Cleanup-Image /RevertPendingActions
2. Restart your PC and try to boot to Windows normally.
Mert Cesur
August 9, 2019 @ 7:38 pm
Hello, i’m from Turkey so my English is not good.
My windows folder is in C disk.
I wrote “dism.exe /Image:C:\ /Cleanup-Image /RestoreHealth” after than i give me a Error: 2 An initialization error occured. For more information, review the log file.
The DISM log file can be found at X:\windows\logs\DISM\dism.log
Lakonst2013
August 31, 2019 @ 10:30 am
1. Run this command: DISM /Image:C:\ /ScratchDir:C:\Scratch /Cleanup-Image /RevertPendingActions
2. Restart your PC and try to boot to Windows normally.
Greg
August 11, 2019 @ 3:49 pm
I got error 0x800f081f
The source files could not be found,
Use the “source” option to specify the location of files that are required to restore the feature.
What am I doing wrong?
Lakonst2013
August 31, 2019 @ 10:46 am
@Greg: Nothing. The Windows installation is damaged. I suggest to perform a Windows 10 repair upgrade. To do that:
a. boot from the Windows USB media.
b. At Windows Setup wizard, press 'Next' and then click 'Install Now'.
c. Accept the 'License agreement'.
d. When asked, select Upgrade: Install Windows and keep files, settings, and applications.
JJ
September 4, 2019 @ 10:22 pm
Hi there!
I successfully got through step 5 and executed "SFC /SCANNOW /OFFBOOTDIR=D:\ /OFFWINDIR=D:\Windows"
Now I am stuck on "Beginning system scan. This process will take sometime."
Any idea how much time can it take?
Lakonst2013
September 5, 2019 @ 8:56 am
JJ: In most cases about half hour.
JP
October 9, 2019 @ 11:51 am
Same here. I could scanhealth and it didn't find any problem. However, scannow is stuck with the same message and it's been over an hour. Without displaying the percentage or anything.
Help
JP
October 9, 2019 @ 1:02 pm
After I minimized the window and reopened, the message was there saying the scan finished without a problem.
Still, my PC won't start.. I don't know why this happened to it.
The problem started after I restarted the PC, but I often did and the windows version was the newest.
I used a pre-installed software called "HP Power AC" or something that let's you keep your battery low even when the PC is connected to the adapter. It was before I restarted the PC. Do you think it caused the issue?
Lakonst2013
October 9, 2019 @ 1:15 pm
What are the symptoms? Are you getting any error message?
Elizabeth
September 17, 2019 @ 9:10 pm
I got error 50 again. It tells me I need the latest version of the dism but I can't even get into my computer since it won't let me enter my pin (and I can't enter safemode which is why I am doing this).
Lakonst2013
September 18, 2019 @ 9:54 am
Try to reset the password with these instructions: https://www.repairwin.com/how-to-reset-password-in-windows-10-8-7-vista/
Chris
February 21, 2020 @ 5:14 pm
Hello, First let me say this is a fantastic resource: Thank you. I have tried every built-in option to recover and repair my Windows 10 laptop. I even had problems booting directly into command mode. I can not longer even boot into safe mode. I found your blog and I verified windows is on drive: C:: and ran:
dism.exe /image:c:\ /cleanup-image /restorehealth. It completed quickly with "error: 23" I checked the syntax and retried: no change. I then tried: scn /scannow /offbootdir=c:\ /offwinddir=c:\windows … it starts, then returns:
windows resource protection could not perform the requested operation
I have been very careful to check my syntax for typos. I'm still having fun trying to fix this, but have been working on it for days. Again: I have tried every option from within W10, even trying to boot with the Windows media creation tool from a flash drive. It goes into the endless repair loop "Can't repair" , unsuccessful, etc etc. Note: When this all started, I -was- able to do a fresh re-set saving with the WIN10 tool: NOTHING saved, and it ran fine for a few days: then back to square one. Any ideas? I'm thinking either the drive or motherboard is the culprit. Earlier safe mode scans with Kaspersky, MalwareBytes and the Kaspersky Malicious Software removal tool turned up nothing.
I'm wondering if there is anything left other than trying to reformat the drive
Chris
February 21, 2020 @ 5:29 pm
I was also able to run:
DISM /Image:C:\ /ScratchDir:C:\Scratch /Cleanup-Image /RevertPendingActions
This returned:
Deployment Imaging Servicing and Management tool
Version: 10.0.18362.1
Error: 123
Unable to access the image.
Make sure that the image path and the Windows directory for the image exist and you have Read permissions on the folder……
Sounds like we're done here?? :)
Lakonst2013
February 22, 2020 @ 9:54 am
I believe that the drive is damaged. Connect it to another computer (if you can), backup you files and test the drive for errors. If the drive is OK then perform a clean Windows installation.
Colin
April 25, 2020 @ 5:22 am
The DISM command and the SFC command completed without errors.
The laptop still fails to boot, defaulting to the troubleshooter.
I suspect we have a damaged hard disk.
Any other possibilities?
Lakonst2013
April 25, 2020 @ 11:08 am
Try the methods in this post: https://www.repairwin.com/fix-automatic-repair-couldnt-repair-your-pc-srttrail-txt-solved/
James
May 15, 2020 @ 12:14 am
Thank you, you are an absolute godsend!!!!!
Jesse
June 27, 2020 @ 9:58 am
Hello, when I try to run "SFC /SCANNOW /OFFBOOTDIR=D:\ /OFFWINDIR=D:\Windows", I get "windows resource protection not perform the requested operation"
When I try to run the Windows repair update from USB boot drive it says "Upgrade option is not available because there is already a copy of windows 10 on the drive" paraphrasing here.
Can't run DISM because I am offline and I created a scratch directory but it still gave an error message? Can you please help me here. Thanks
Lakonst2013
June 27, 2020 @ 1:04 pm
Make sure that you use the correct USB Windows installation media according your Windows edition and architecture. (e.g. If you have Windows 10 64bit, you need Windows 10 64bit USB installation media.)
Jesse
June 28, 2020 @ 10:25 am
Yes I created the usb media with Windows 10 64bit, but it seem that it doesn't allow the user to reinstall over your existing system to just fix windows, you can only do that after loading Windows…with this offline option it is only to remove partitions and do a complete reinstall? Any ideas on the other commands? I really want to do a SFC Scan and DISM scan..
Lakonst2013
June 29, 2020 @ 10:49 am
I suggest you to make sure that the folder 'Windows' is in Drive D:\
Jim
July 12, 2020 @ 2:04 am
Excellent Post & Follow-up. Thanks!
I'm working on a client's machine. Client claims they installed Windows 10 over Windows 7 some time ago.
Running WMIC Logicaldisk get name returns C:, D:, E:, F:, G:, X:
dir E: returns Windows7_OS
dir G: returns Device not Ready
Is it possible they installed Win 10 on G: and that's corrupted?
Running dism.exe /Image:G:\ /Cleanup-Image /RestoreHealth – returns "Error 21 – Unable to access Image."
Running chkdsk G: /f /r /x – returns "Cannot open volume for direct access"
I am beginning to think the client may have not successfully installed Win10, and my job is to then resurrect the Win 7 Image.
Thanks
Jim
Lakonst2013
July 12, 2020 @ 10:31 am
What is the DIR result on C: and F: drives?
Ed
November 8, 2020 @ 7:27 pm
I tried this, but when I ran the command SFC /SCANNOW /OFFBOOTDIR=D:\ /OFFWINDIR=D:\Windows I got the message
There is a system repair pending which requires a rebooot to compete. Restart windows and run Ssfc again.
I tried this from both my recovery USB and without it but I keep getting this message when I run the sfc command.
Help
Lakonst2013
November 19, 2020 @ 11:15 am
At your case follow apply first the steps in this tutorial: FIX: It looks like you started an upgrade and booted from installation media
Ed
November 9, 2020 @ 2:07 pm
Hi
I am not e techie, but I am trying to fix an 8 year old pc, originally Windows 7 but upgraded over the years to the latest version of Windows 10.
Last week it crashed on rebooting with the error SYSTEM THREAD EXCEPTION NOT HANDLED.
I have been unable to boot into Safe Mode or restore the system from a Restore Point, and Startup Repair did not fix the problem, so I have created a bootable USB with Windows 10.
When I enter
SFC /SCANNOW /OFFBOOTDIR=F:\ /OFFWINDIR=F:\WINDOWS
I get the error message
There is a system repair pending which requires reboot to compete. Restart windows and run sfc again.
I have tried rebooting my pc without success.
Can you help resolve this, please?
Ed
November 9, 2020 @ 2:31 pm
Further to the above, can I safely delete the file pending.xml in the WinSxs folder? This is a suggestion on another forum
Lakonst2013
November 11, 2020 @ 9:48 am
Yes, it's OK to delete the pendimg.xml file.