Need help repairing the winsxs folder

tlr08

New member
Local time
6:10 PM
Messages
8
Location
Finland
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 :doh:
 
Last edited:

My Computers My Computers

  • At a glance

    Windows 7 Ultimate x64Intel® Core™ i5-9400F8 GB DDR4-2666 SDRAM (1 x 8 GB)NVIDIA® GeForce® GTX 1650
    Computer type
    PC/Desktop
    Computer Manufacturer/Model Number
    HP Pavilion Gaming Desktop 690-0050no
    OS
    Windows 7 Ultimate x64
    CPU
    Intel® Core™ i5-9400F
    Motherboard
    HP Lincs
    Memory
    8 GB DDR4-2666 SDRAM (1 x 8 GB)
    Graphics Card(s)
    NVIDIA® GeForce® GTX 1650
    Screen Resolution
    1920x1080p
    Hard Drives
    256 GB PCIe® NVMe™ M.2 SSD
    2 TB WD Blue 7200 RPM 3.5" SATA HDD
    Internet Speed
    12 Mbps download 11 Mbps upload [ADSL]
    Antivirus
    Malwarebytes
    Browser
    Firefox 84.0 x64
  • Computer type
    PC/Desktop
    Antivirus
    Malwarebytes
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 Computers My Computers

  • At a glance

    Windows 7 Ultimate x64Intel® Core™ i5-9400F8 GB DDR4-2666 SDRAM (1 x 8 GB)NVIDIA® GeForce® GTX 1650
    Computer type
    PC/Desktop
    Computer Manufacturer/Model Number
    HP Pavilion Gaming Desktop 690-0050no
    OS
    Windows 7 Ultimate x64
    CPU
    Intel® Core™ i5-9400F
    Motherboard
    HP Lincs
    Memory
    8 GB DDR4-2666 SDRAM (1 x 8 GB)
    Graphics Card(s)
    NVIDIA® GeForce® GTX 1650
    Screen Resolution
    1920x1080p
    Hard Drives
    256 GB PCIe® NVMe™ M.2 SSD
    2 TB WD Blue 7200 RPM 3.5" SATA HDD
    Internet Speed
    12 Mbps download 11 Mbps upload [ADSL]
    Antivirus
    Malwarebytes
    Browser
    Firefox 84.0 x64
  • Computer type
    PC/Desktop
    Antivirus
    Malwarebytes
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 My Computers

  • At a glance

    7 X64i5 84002x8gb 3200mhz
    Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • At a glance

    7x64g54008gb ddr4 2400
    Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
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 Computers My Computers

  • At a glance

    Windows 7 Ultimate x64Intel® Core™ i5-9400F8 GB DDR4-2666 SDRAM (1 x 8 GB)NVIDIA® GeForce® GTX 1650
    Computer type
    PC/Desktop
    Computer Manufacturer/Model Number
    HP Pavilion Gaming Desktop 690-0050no
    OS
    Windows 7 Ultimate x64
    CPU
    Intel® Core™ i5-9400F
    Motherboard
    HP Lincs
    Memory
    8 GB DDR4-2666 SDRAM (1 x 8 GB)
    Graphics Card(s)
    NVIDIA® GeForce® GTX 1650
    Screen Resolution
    1920x1080p
    Hard Drives
    256 GB PCIe® NVMe™ M.2 SSD
    2 TB WD Blue 7200 RPM 3.5" SATA HDD
    Internet Speed
    12 Mbps download 11 Mbps upload [ADSL]
    Antivirus
    Malwarebytes
    Browser
    Firefox 84.0 x64
  • Computer type
    PC/Desktop
    Antivirus
    Malwarebytes
what do you mean by settings
 

My Computers My Computers

  • At a glance

    7 X64i5 84002x8gb 3200mhz
    Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • At a glance

    7x64g54008gb ddr4 2400
    Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
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 Computers My Computers

  • At a glance

    Windows 7 Ultimate x64Intel® Core™ i5-9400F8 GB DDR4-2666 SDRAM (1 x 8 GB)NVIDIA® GeForce® GTX 1650
    Computer type
    PC/Desktop
    Computer Manufacturer/Model Number
    HP Pavilion Gaming Desktop 690-0050no
    OS
    Windows 7 Ultimate x64
    CPU
    Intel® Core™ i5-9400F
    Motherboard
    HP Lincs
    Memory
    8 GB DDR4-2666 SDRAM (1 x 8 GB)
    Graphics Card(s)
    NVIDIA® GeForce® GTX 1650
    Screen Resolution
    1920x1080p
    Hard Drives
    256 GB PCIe® NVMe™ M.2 SSD
    2 TB WD Blue 7200 RPM 3.5" SATA HDD
    Internet Speed
    12 Mbps download 11 Mbps upload [ADSL]
    Antivirus
    Malwarebytes
    Browser
    Firefox 84.0 x64
  • Computer type
    PC/Desktop
    Antivirus
    Malwarebytes

My Computers My Computers

  • At a glance

    7 X64i5 84002x8gb 3200mhz
    Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • At a glance

    7x64g54008gb ddr4 2400
    Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
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 My Computer

At a glance

W7 home premium 32bit/W7HP 64bit/w10 tp insid...E5300 dual core3gbNvidia Geforce 7100 Nforce 630i
Computer type
PC/Desktop
Computer Manufacturer/Model Number
medionl/Aspire 6930G/acer x55a
OS
W7 home premium 32bit/W7HP 64bit/w10 tp insider ring
CPU
E5300 dual core
Motherboard
medion MS7366
Memory
3gb
Graphics Card(s)
Nvidia Geforce 7100 Nforce 630i
Monitor(s) Displays
avixc
Internet Speed
n (isp resticted to 72)
Antivirus
mse/pands
Browser
palemoon
Other Info
Belkin Fd7050 n USB using Railink RT2870 drivers, more upto date
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.

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 Computers My Computers

  • At a glance

    Windows 7 Ultimate x64Intel® Core™ i5-9400F8 GB DDR4-2666 SDRAM (1 x 8 GB)NVIDIA® GeForce® GTX 1650
    Computer type
    PC/Desktop
    Computer Manufacturer/Model Number
    HP Pavilion Gaming Desktop 690-0050no
    OS
    Windows 7 Ultimate x64
    CPU
    Intel® Core™ i5-9400F
    Motherboard
    HP Lincs
    Memory
    8 GB DDR4-2666 SDRAM (1 x 8 GB)
    Graphics Card(s)
    NVIDIA® GeForce® GTX 1650
    Screen Resolution
    1920x1080p
    Hard Drives
    256 GB PCIe® NVMe™ M.2 SSD
    2 TB WD Blue 7200 RPM 3.5" SATA HDD
    Internet Speed
    12 Mbps download 11 Mbps upload [ADSL]
    Antivirus
    Malwarebytes
    Browser
    Firefox 84.0 x64
  • Computer type
    PC/Desktop
    Antivirus
    Malwarebytes
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 Computers My Computers

  • At a glance

    Windows 7 Ultimate x64Intel® Core™ i5-9400F8 GB DDR4-2666 SDRAM (1 x 8 GB)NVIDIA® GeForce® GTX 1650
    Computer type
    PC/Desktop
    Computer Manufacturer/Model Number
    HP Pavilion Gaming Desktop 690-0050no
    OS
    Windows 7 Ultimate x64
    CPU
    Intel® Core™ i5-9400F
    Motherboard
    HP Lincs
    Memory
    8 GB DDR4-2666 SDRAM (1 x 8 GB)
    Graphics Card(s)
    NVIDIA® GeForce® GTX 1650
    Screen Resolution
    1920x1080p
    Hard Drives
    256 GB PCIe® NVMe™ M.2 SSD
    2 TB WD Blue 7200 RPM 3.5" SATA HDD
    Internet Speed
    12 Mbps download 11 Mbps upload [ADSL]
    Antivirus
    Malwarebytes
    Browser
    Firefox 84.0 x64
  • Computer type
    PC/Desktop
    Antivirus
    Malwarebytes
Back
Top