2

I want to repair a corrupted Windows installed on a hard disk through another PC.The wim file that I use as a source for repair was extracted from another wim file that contains several versions of Windows, and I actually extracted a version of Windows that matched version of my corrupted Windows. I received the following message in the log file of the DISM command, I want to know what it means? Does it refer to a corrupted file system? How should I fix this error?

Command used :

Dism /image:G:\ /Cleanup-Image /RestoreHealth /Source:H:\install.wim /LimitAccess /Logpath:H:\dism.log

Error message:

Warning CBS The alternate source path directory could not be accessed [HRESULT = 0x8007007b - ERROR_INVALID_NAME]
JW0914
  • 7,865
SEPEHR
  • 61
  • What was the DISM command that you used? – harrymc Feb 14 '24 at 15:31
  • "Does it refer to a corrupted file system?" - No; It means the source directory couldn't be accessed. – Ramhound Feb 14 '24 at 15:52
  • Which directory does it say? @Ramhound – SEPEHR Feb 14 '24 at 16:14
  • Please add to your post the DISM command that you used. – harrymc Feb 14 '24 at 16:17
  • Dism /image:C:\ /Cleanup-Image /RestoreHealth /Source:D:\install.wim /LimitAccess /Logpath:D:\dism.log

    @harrymc

    – SEPEHR Feb 14 '24 at 16:22
  • @SEPEHR - "Which directory does it say?" - It would be "D:\install.wim" – Ramhound Feb 14 '24 at 16:25
  • are you sure?

    @Ramhound

    – SEPEHR Feb 14 '24 at 16:27
  • @SEPEHR What is the size of the D:\install.wim file? – Andrew Morton Feb 14 '24 at 16:39
  • The error might mean that D:\install.wim doesn't exist. – harrymc Feb 14 '24 at 16:40
  • @SEPEHR - I am positive. Considering, the error message you received, "The alternate source path directory could not be accessed." – Ramhound Feb 14 '24 at 16:42
  • @ Andrew Morton - "What is the size of the D:\install.wim file?" - 3.28 GB – SEPEHR Feb 14 '24 at 20:02
  • @Ramhound - Why can't the directory be accessed? How can I fix the problem? – SEPEHR Feb 14 '24 at 20:09
  • @SEPEHR - It's likely a syntax problem. Why are you not editing your question? Why do you need to provide the windows image. You should be able to use /Online. What problem are you trying to resolve by running this command? – Ramhound Feb 14 '24 at 20:20
  • @Ramhound - What do you mean by "syntax problem"?

    I want to repair a corrupted Windows installed on a hard disk through another PC, that's why I don't use the online parameter.

    – SEPEHR Feb 15 '24 at 00:29
  • Let’s start over: run dism /Get-WimInfo /WimFile:D:\install.wim, if that doesn’t work, then the path to the windows image file isn’t correct. Provide a screenshot of the folder that contains the file with the full path show. This windows image is the mounted ISO I presume? Which means it’s a read only directory. [Edit] your question to include this information. It’s unfair but what I am asking for is very reasonable, asking what I mean by a “syntax problem” is frustrating since what I mean is crystal clear – Ramhound Feb 15 '24 at 01:23

1 Answers1

0

The command structure is incorrect - correct command to repair the Component Store [Windows\WinSxS] of an offline Windows image:


  • There's no need to export a WIM from a multi-index ESD/WIM, as the index number must be specified regardless
    • Doing so creates more problems than it solves since an install.esd is always <4GB due to its compression ratio being 33% more efficient than WIM's, whereas an install.wim will always be >4GB (an issue for an EFI bootable Install USB formatted as FAT32)

  1. Ascertain the ESD/WIM index numbers and version/build info via /Get-ImageInfo:
    # Default install.<esd|wim> index numbers - Home: 1 | Pro: 6
      Dism /Get-ImageInfo /ImageFile:"H:\install.<esd|wim>"
    

    Verify version and build information:

    Dism /Get-ImageInfo /ImageFile:"H:\install.<esd|wim>" /Index:#

    PS $ Dism /Get-ImageInfo /ImageFile:"E:\sources\install.esd"
    
      Deployment Image Servicing and Management tool
      Version: 10.0.22621.2792
    
        Details for image : E:\sources\install.esd
    
          Index : 1
          Name : Windows 11 Home
          Description : Windows 11 Home
          Size : 16,168,829,996 bytes
    
          Index : 2
          Name : Windows 11 Home N
          Description : Windows 11 Home N
          Size : 15,506,889,019 bytes
    
          Index : 3
          Name : Windows 11 Home Single Language
          Description : Windows 11 Home Single Language
          Size : 16,153,401,297 bytes
    
          Index : 4
          Name : Windows 11 Education
          Description : Windows 11 Education
          Size : 16,463,631,301 bytes
    
          Index : 5
          Name : Windows 11 Education N
          Description : Windows 11 Education N
          Size : 15,808,633,936 bytes
    
          Index : 6
          Name : Windows 11 Pro
          Description : Windows 11 Pro
          Size : 16,479,089,353 bytes
    
          Index : 7
          Name : Windows 11 Pro N
          Description : Windows 11 Pro N
          Size : 15,810,170,147 bytes
    
    
    PS $ Dism /Get-ImageInfo /ImageFile:"E:\sources\install.esd" /Index:1
    
       Deployment Image Servicing and Management tool
       Version: 10.0.22621.2792
    
          Details for image : E:\sources\install.esd
    
             Index : 1
             Name : Windows 11 Home
             Description : Windows 11 Home
             Size : 16,168,829,996 bytes
             WIM Bootable : No
             Architecture : x64
             Hal : <undefined>
             Version : 10.0.22621
             ServicePack Build : 525
             ServicePack Level : 0
             Edition : Core
             Installation : Client
             ProductType : WinNT
             ProductSuite : Terminal Server
             System Root : WINDOWS
             Directories : 22687
             Files : 102254
             Created : 2022.09.24 - 20:47:30
             Modified : 2022.11.11 - 07:04:21
             Languages : en-US (Default)
    
    
    PS $ Dism /Get-ImageInfo /ImageFile:"E:\sources\install.esd" /Index:6
    
       Deployment Image Servicing and Management tool
       Version: 10.0.22621.2792
    
          Details for image : E:\sources\install.esd
    
            Index : 6
            Name : Windows 11 Pro
            Description : Windows 11 Pro
            Size : 16,479,089,353 bytes
            WIM Bootable : No
            Architecture : x64
            Hal : <undefined>
            Version : 10.0.22621
            ServicePack Build : 525
            ServicePack Level : 0
            Edition : Professional
            Installation : Client
            ProductType : WinNT
            ProductSuite : Terminal Server
            System Root : WINDOWS
            Directories : 22867
            Files : 103384
            Created : 2022.09.24 - 20:47:30
            Modified : 2022.11.11 - 07:04:29
            Languages : en-US (Default)
    

  2. /Cleanup-Image has a hierarchical order, so first run /StartComponentCleanup to clean the Component Store of any broken hard links, then run /RestoreHealth:
    # Clean the offline image's Component Store:
      Dism /Image:"G:\Windows" /Cleanup-Image /StartComponentCleanup
    

    Specify the index number at the end of the /Source parameter:

    ESD:

    Dism /Image:&quot;G:\Windows&quot; /Cleanup-Image /RestoreHealth /Source:esd:&quot;H:\install.esd&quot;:1 /LimitAccess /Logpath:&quot;H:\dism.log&quot;
    
    

    WIM:

    Dism /Image:&quot;G:\Windows&quot; /Cleanup-Image /RestoreHealth /Source:wim:&quot;H:\install.wim&quot;:1 /LimitAccess /Logpath:&quot;H:\dism.log&quot;
    

    • While the OP mentioned this in their question, the /Source must match the exact version [23H2, 24H1, etc.] of the offline Windows image being repaired (I'm unsure if the build version must also match)

  3. Once /Cleanup-Image has successfully completed its repair of the Component Store, Sfc /ScanNow must also be run against the offline image to repair the OS files (/Cleanup-Image and /ScanNow are inextricably linked):
    # Repair offline Windows image OS files:
      Sfc /ScanNow /OffBootDir=G:\ /OffWinDir=G:\Windows /OffLogFile=H:\sfc.log
    

    Export repair details to seperate log for efficient viewing:

    FindStr /c:"[SR]" "H:\sfc.log" > "H:\SFCdetails.log"

    (Log files are easier to read and sift through via the Log syntax in VS Code)

JW0914
  • 7,865
  • "Dism /Image:G:\Windows /Cleanup-Image /RestoreHealth /Source:wim:H:\install.wim:1 /LimitAccess /Logpath:H:\dism.log"

    I ran this command and it gave this error :

    "Unable to access the image. Make sure that the image path and the Windows directory for the image exist a you have Read permissions on the folder."

    – SEPEHR Feb 15 '24 at 20:39
  • @SEPEHR That's an ACL permissions issue - I'm assuming it's being run from an Admin terminal? Try using the original install.esd, and if it's still giving the error, extract the Component Store [Windows\WinSxS] from the correct install.<esd|wim> index and change to /Source:"H:\Windows\WinSxS" to see if it still gives the error from and Admin terminal – JW0914 Feb 15 '24 at 22:00
  • @ JW0914 - As you said, I extracted "Windows\WinSxS" to C: drive and ran this command: [Dism /Image:G:\Windows /Cleanup-Image /RestoreHealth /Source:C:\New Folder\Windows\ WinSxS /LimitAccess /Logpath:H:\dism.log] and gave this error: [DISM doesn't recognize the command-line option "Folder\Windows\WinSxS".] – SEPEHR Feb 17 '24 at 19:58
  • Hes quoting source, maybe you should too ;) /Source:"C:\New Folder\Windows\WinSxS" – Danijel Feb 17 '24 at 22:59
  • @SEPEHR If that does not resolve, please copy/paste all terminal content and the %WinDir%\Logs\DISM\dism.log and %WinDir%\Logs\CBS\cbs.log into separate code boxes within your question. This answer and its commands are pulled directly from the linked to man pages (the same content can be output with Dism /Online /Cleanup-Image /? - I'm unsure if Dism /Image:G:\Windows /Cleanup-Image /? will result in the help being displayed) – JW0914 Feb 18 '24 at 12:43