Need help repairing the winsxs folder


  1. Posts : 8
    Windows 7 Ultimate x64
       #1

    Need help repairing the winsxs folder


    So one day my computer was running low on storage. I noticed that the winsxs folder was taking up a decent chunk of storage. All I knew about the winsxs folder at the time was that it was the "windows update folder" so I thought that it wouldn't really do much harm to clear it out (in the back of my mind I knew it might not be the best idea but I was stressed and just wanted to clean up some space quickly so I didn't really think it through). So after deleting everything in it I rebooted my computer and after the "starting windows" animation there was just a black screen.


    Then I thought that mabye I could copy the winsxs folder from a working installation to the broken one. So I intalled Windows on a separate partition on my extra HDD and copied the winsxs folder from there to the broken install.
    When I booted into it there was still a black screen but now I could see the mouse! But still I couldn't log in or do anything (I could still see the mouse cursor spinning every once in a while).



    In the working installation tried to run:

    sfc /scannow /offbootdir=E:\ /offwindir=E:\Windows

    but I got

    Windows Resource Protection could not start the repair service.

    (sfc /scannow still worked fine on the online installation)
    I thought that mabye it wasn't working because it is an EFI install, so I mounted the EFI partition (F:\) and tried to point it to the folders there but to no avail:

    sfc /scannow /offbootdir=F:\ /offwindir=E:\Windows


    Windows Resource Protection could not start the repair service.


    sfc /scannow /offbootdir=F:\EFI\Microsoft /offwindir=E:\Windows


    Windows Resource Protection could not start the repair service.


    sfc /scannow /offbootdir=F:\EFI\Microsoft\Boot /offwindir=E:\Windows


    Windows Resource Protection could not start the repair service.


    sfc /scannow /offbootdir=F:\EFI\Boot /offwindir=E:\Windows


    Windows Resource Protection could not start the repair service.


    I found a tool called SFCFix that looked like it would be able to help but I couldnt figure out how to point it to an offline installation.


    Help would be appreciated as I really want to try to avoid reinstalling Windows as I would have to transfer user data, programs, program data, environment variables, registry keys, reinstall SDKs etc.. and that would take a lot of time and effort.

    If there is one thing I've learned from this it is to backup regularly in case anything goes wrong.

    side note: I thought that had system restore (shadow copy) enabled but turns out it was only enabled for my other drive not my OS drive
    Last edited by tlr08; 22 Oct 2023 at 16:06. Reason: change [code] tags to [c] tags
      My Computer


  2. Posts : 8
    Windows 7 Ultimate x64
    Thread Starter
       #2

    Additional Information


    I should also mention that whenever I try to issue any DISM command on the system I get the following message:

    Error: 3

    The directory E:\Windows does not appear to be a valid Windows directory.


    Here is the relevant part of the DISM log:

    2023-10-22 23:41:23, Info DISM DISM OS Provider: PID=4456 Setting Windows folder to E:\Windows - CDISMOSServiceManager::SetWindowsDirectory
    2023-10-22 23:41:23, Info CSI 00000001 Shim considered [l:256{128}]"\??\E:\Windows\Servicing\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_6.1.7601.26016_none_681086caf7066858\pkgmgr.exe" : got STATUS_OBJECT_PATH_NOT_FOUND
    2023-10-22 23:41:23, Info CSI 00000002 Shim considered [l:250{125}]"\??\E:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_6.1.7601.26016_none_681086caf7066858\pkgmgr.exe" : got STATUS_OBJECT_NAME_NOT_FOUND
    2023-10-22 23:41:23, Info CSI 00000003 Shim considered [l:112{56}]"\??\E:\Windows\Servicing\6.1.7601.26016_amd64\pkgmgr.exe" : got STATUS_OBJECT_PATH_NOT_FOUND
    2023-10-22 23:41:23, Info CSI 00000004 Shim considered [l:106{53}]"\??\E:\Windows\WinSxS\6.1.7601.26016_amd64\pkgmgr.exe" : got STATUS_OBJECT_PATH_NOT_FOUND
    2023-10-22 23:41:23, Error CSI 00000005 (F) HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) #1# from SssBindServicingStackParams={cb=00000040, flags=00000004, image={cb=00000010, flags=00000000, pcwszWindir=[10]"E:\Windows"}} Cookie=(inner-null), Disp=1[gle=0x80070003]
    2023-10-22 23:41:23, Error CSI 00000006@2023/10/22:20:41:23.991 (F) d:\w7rtm\base\wcp\shim\binder.cpp(615): Error HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) originated in function SssBindServicingStack expression: (pInputParameters->dwFlags & (0x00000020))
    [gle=0x80004005]
    2023-10-22 23:41:23, Warning DISM DISM OS Provider: PID=4456 Failed to bind the offline servicing stack. Make sure that the Windows directory has been set. - CDISMOSServiceManager::get_ServicingStackDirectory(hr:0x80070003)
    2023-10-22 23:41:23, Error DISM DISM OS Provider: PID=4456 Unable to retrieve servicing stack folder for DLL search path modification. - CDISMOSServiceManager::SetDllSearchPath(hr:0x80070003)
    2023-10-22 23:41:23, Error DISM DISM OS Provider: PID=4456 Unable to set the DLL search path to the servicing stack folder. E:\Windows may not point to a valid Windows folder. - CDISMOSServiceManager::SetWindowsDirectory(hr:0x80070003)
    2023-10-22 23:41:23, Error DISM DISM.EXE: Failed to set the windows directory to 'E:\Windows'. HRESULT=80070003


    I am guessing that this is probably also why SFC refused to run.
      My Computer


  3. Posts : 16,163
    7 X64
       #3

    It is probabaly the wrong version of the servicing stack. winsxs on a new installtion is not the same as winsxs on your sick installation particularly after updates.

    If you havent got a shadow copy or backup image you are up the creek.
      My Computers


  4. Posts : 8
    Windows 7 Ultimate x64
    Thread Starter
       #4

    SIW2 said:
    It is probabaly the wrong version of the servicing stack. winsxs on a new installtion is not the same as winsxs on your sick installation particularly after updates.

    If you havent got a shadow copy or backup image you are up the creek.
    Ok, that is unfortunate. Well in that case, do you know of any simple way of transfering windows settings? Or will I just have to go and copy regkeys manually?
      My Computer


  5. Posts : 16,163
    7 X64
       #5

    what do you mean by settings
      My Computers


  6. Posts : 8
    Windows 7 Ultimate x64
    Thread Starter
       #6

    SIW2 said:
    what do you mean by settings
    Like env variables, pinned apps in taskbar and startmenu, group policy, default apps, themes, firewall settings, fonts, internet optins. Those type of things.
      My Computer


  7. Posts : 16,163
    7 X64
       #7

    will I just have to go and copy regkeys manually?
    you can try

    - - - Updated - - -

    If you want to compare the hives of the old and new installations and export the differences, you could use something like
    Registry Workshop | www.torchsoft.com
      My Computers


  8. Posts : 7,107
    W7 home premium 32bit/W7HP 64bit/w10 tp insider ring
       #8

    you could try running kb947821, then post the log from the CBS folder
    (that KB was DISM's predeccessor)

    by the way which drive is the OS installed on C E or F ???
      My Computer


  9. Posts : 8
    Windows 7 Ultimate x64
    Thread Starter
       #9

    torchwood said:
    by the way which drive is the OS installed on C E or F ???
    All commads were run from a fresh install installed on a separate drive from the broken one. C is the drive where the new install is, E is the broken install I'm trying to fix, and F is the EFI partition.

    torchwood said:
    you could try running kb947821, then post the log from the CBS folder
    The tool only checks the online system, which is the fresh install, so it reports no errors. I can't run it on the broken install since I can't log in to it (black screen with cursor).
      My Computer


  10. Posts : 8
    Windows 7 Ultimate x64
    Thread Starter
       #10

    SIW2 said:
    you can try

    - - - Updated - - -

    If you want to compare the hives of the old and new installations and export the differences, you could use something like
    Registry Workshop | www.torchsoft.com
    I think I've got everything now, except for one thing.
    How do I copy drivers?
    I assume it's not as simple as just copying the \Windows\System32\Drivers folder?

    - - - Updated - - -

    I managed to add the drivers by booting into WinPE and running
    Dism /Image:D:\ /Add-Driver /Driver:E:\Windows\System32\DriverStore\FileRepository /Recurse
    (D = new system E = old system)
    Then when I booted back into Windows it automatically installed all of the drivers. :)
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 11:38.
Find Us