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
  • 9,096
SEPEHR
  • 81
  • 2
  • 7

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
  • 9,096