Skip to content

77 Comments

  1. 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.

    Reply

    • Danny
      December 8, 2022 @ 3:48 pm

      None of the commands in the article are working, for example:

      "Error: 1639

      The command-line is missing a required servicing command."

      this in response to: dism.exe/Image:D:\/Cleanup-Image/Restorehealth

      Reply

      • Lakonst2013
        December 8, 2022 @ 6:40 pm

        You forget the space…(dism.exe SPACE /Image:D:\ SPACE /Cleanup-image SPACE /RestoreHealth"

        Reply

  2. 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?

    Reply

    • Lakonst2013
      February 11, 2019 @ 12:16 pm

      Ryan Bartlett: I suppose that the Windows Drive letter is not the C: but another letter..

      Reply

    • real tech
      February 12, 2019 @ 11:54 am

      Read point 2 again

      Reply

  3. 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.

    Reply

    • 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").

      Reply

      • 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.

        Reply

        • 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

          Reply

  4. 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!

    Reply

    • 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

      Reply

      • Andrew
        November 23, 2019 @ 9:10 pm

        Cool, this space fix works!!
        Author could you please fix this in your article?

        Reply

  5. 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.

    Reply

  6. 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

    Reply

    • 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

      Reply

      • 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..

        Reply

        • Lakonst2013
          August 28, 2019 @ 12:41 pm

          Tamal Samaddar: Do not leave out the space between \ /

          Reply

          • 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.

  7. arbenek
    April 18, 2019 @ 9:43 am

    What a wonderful solution! Thank you so much…

    Reply

  8. Marcos Silva
    April 28, 2019 @ 8:54 pm

    After 2 days trying other alternatives, this solution worked fine for me. Thanks a lot!

    Reply

  9. 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.

    Reply

    • Lakonst2013
      August 31, 2019 @ 10:57 am

      Kamran: What OS you have? The instructions are only for Windows 10.

      Reply

  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

    Reply

    • 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

      Reply

  11. 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!

    Reply

  12. Snir Amira
    July 12, 2019 @ 12:02 am

    i have error number 605 what should i do???????

    Reply

  13. Jimy
    July 18, 2019 @ 2:25 pm

    Error 0xc0000135
    Error al intentar iniciar el proceso de servicio para la imagen ubicada en D:/

    Reply

    • 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.

      Reply

  14. 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!!

    Reply

  15. 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!

    Reply

    • 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.

      Reply

  16. 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

    Reply

    • 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.

      Reply

  17. 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?

    Reply

    • 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.

      If you cannot perform the upgrade, then backup you files and clean install Windows again.

      Reply

  18. 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?

    Reply

    • Lakonst2013
      September 5, 2019 @ 8:56 am

      JJ: In most cases about half hour.

      Reply

      • 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

        Reply

        • 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?

          Reply

          • Lakonst2013
            October 9, 2019 @ 1:15 pm

            What are the symptoms? Are you getting any error message?

  19. 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).

    Reply

    • 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/

      Reply

      • Friend of the U.S.
        January 12, 2023 @ 5:20 am

        Hi. DISM.EXE command brings up the Error:50 message for me too. My issue comes from a system restore loop.

        Had to shut it down after twelve hours.
        When I restarted the computer, it started, "Preparing for Automatic repair" and after, "Diagnosing your PC" it gave a failure message. Said unable to repair. Try advanced options or shutdown.

        Can't enter into safe mode with networking or anything without password. Yet, my password is correct.

        chkdsk scan showed no corruption.

        Having a issue getting into Safe Mode (F8) due to the automatic startup (Automatic system repair) interrupts as Safe mode option appears.

        Then it does the same, "Automatic System Repair" spiel.

        Reply

  20. 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

    Reply

  21. 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?? :)

    Reply

    • 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.

      Reply

  22. 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?

    Reply

  23. James
    May 15, 2020 @ 12:14 am

    Thank you, you are an absolute godsend!!!!!

    Reply

  24. 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

    Reply

    • 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.)

      Reply

      • 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..

        Reply

        • Lakonst2013
          June 29, 2020 @ 10:49 am

          I suggest you to make sure that the folder 'Windows' is in Drive D:\

          Reply

  25. 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

    Reply

    • Lakonst2013
      July 12, 2020 @ 10:31 am

      What is the DIR result on C: and F: drives?

      Reply

  26. 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

    Reply

  27. 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?

    Reply

  28. 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

    Reply

    • Lakonst2013
      November 11, 2020 @ 9:48 am

      Yes, it's OK to delete the pendimg.xml file.

      Reply

  29. Camron
    March 28, 2021 @ 2:07 am

    THIS WORKS.

    Wow, I had no idea why the commands every article suggested weren’t working for me. The info on finding the correct drive letter and running DISM with /OFFWINDIR was the key info everyone else was leaving out. Even after specifying that the fix worked “if you can’t boot to your Windows 10 installation”! I can’t thank you enough, you saved me from doing a full reinstall! I’ll be donating for that alone & bookmarking your site for the next time Windows decides to crap out.

    Reply

  30. Ajay
    May 20, 2021 @ 5:10 am

    Wonderful my friend… Thank you for your help..! You made my day

    Reply

  31. Sirnizz
    January 26, 2022 @ 5:33 pm

    Man I don't know if you will ever read this comment again but your explication on this dism command helped me restore my computer now and everytime it worked while nothing else was.

    Thank you very much !

    Reply

  32. suhail
    June 2, 2022 @ 2:31 pm

    thanks a lot…. it worked for me … nicely explained

    Reply

  33. amed
    June 9, 2022 @ 11:16 am

    Some truly fantastic articles on this web site, thanks for contribution .

    Reply

  34. Coyote
    June 17, 2022 @ 3:39 pm

    Yes. Finally someone who knows how to fix the sfc /scannow not working issue

    Can writer also do a post on how to fix the persistant booting into the blue troubleshoot screen using bcdedit?

    **Command prompt. **
    bcdedit /deletevalue (current) safe boot.
    >°Does nothing.

    Keep hetting command not valid, or string not recognised. I tried various alterations. "safeboot", "{current}". Nothing

    **Cmmand prompt. **
    bcdedit /enum
    >the boot configuration data store could not be opened
    >system attempted to load or restore file into registry but…

    Any ideas?

    Reply

  35. Sérgio B. Falasqui
    June 19, 2022 @ 6:02 am

    Hello,
    Thanks for this article, but there is no such a thing as "repair upgrade". Window installation disc doesn't allow that. The only way to use that option is running setup.exe inside Windows, not in PE.

    Reply

  36. Lin
    July 15, 2022 @ 12:38 am

    Hello! Not sure if you're still answering comments, but if you could help then I would highly appreciate it.

    I followed the instructions, and the Windows folder is in C. I put the following command:

    X:\windows\system32>dism.exe /Image C:\ /Cleanup-Image /Restorehealth

    Then it says :

    Deployment Image Servicing and Management tool
    Version: 10.0.19043.1766

    The scratch directory size might be insufficient to perform this operation. This can cause unexpected behavior.
    Use the /ScratchDir option to point to a folder with sufficient scratch space. The recommended sizes at least 1024 MB.

    10.6%
    Error: 112

    There is not enough space on the disk.

    The DISM log file can be found at X:\windows\Logs\DISM\disk.log

    I'm not sure how to use the /ScratchDir option. Could you please let me know how to fix this?

    Reply

    • Lakonst2013
      July 15, 2022 @ 9:21 am

      If the Windows drive is the drive "C:"
      1. Give the following command to create a scratch directory: mkdir C:\Scratch
      2. Then type the DISM command as follows: dism.exe /image:C:\ /ScratchDir:C:\Scratch /Cleanup-Image /Restorehealth

      Reply

  37. Rostom
    July 25, 2022 @ 10:55 am

    Thank you for the helpful guide, i had a blue screen most of the time with the error "unmountable boot volume", after trying to exec chkcfk and sfc tool in the cmd in the boot diagnostic mode, the blue screen disappear but windows hanged in the login screen with the message "Please wait for the session Manager", flowing this guide the issue was resolved.
    Thank you

    Reply

  38. Carmen
    October 19, 2022 @ 3:43 am

    Thank you for such a great post. I tried everything suggested for all different errors. My specific issue is with BitLocker. Windows is in drive C. I get error 267 and everything I tried circulates back to the beginning. I followed few other things with the only configuration options given at the start screen. This a brand new computer, someone in the house started it up and didn't follow proper steps. Now we are stuck with no Microsoft account connected to it, no backup points, cds or usbs, no keys and out of options. We are trying to do a full reset. Another error I get often is Error 0X80310000. Any suggestions?

    Reply

  39. Burkay
    February 2, 2024 @ 10:42 am

    X:\windows\system32>dism.exe /Image:D:\ /Cleanup-Image /RestoreHealth

    Deployment Image Servicing and Management tool

    Version: 10.0.19041.1

    Image Version: 10.0.19041.3996

    The scratch directory size might be insufficient to perform this operation. This can cause unexpected behavior. Use the /ScratchDir option to point to a folder with sufficient scratch space. The recommended size is at least 1024 MB.

    Error: 2

    Sistem belirtilen dosyayı bulamıyor.

    The DISM log file can be found at X:\windows\Logs\DISM\dism.log

    (windows is in D:)

    Reply

    • Konstantinos Tsoukalas
      February 3, 2024 @ 11:32 am

      At your case give the following 2 commands:
      mkdir D:\Scratch
      dism.exe /Image:D:\ /ScratchDir:D:\Scratch /Cleanup-Image /Restorehealth

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *