How to delete folders under C:\Windows\WinSxS\Temp\InFlight


Doc396

Member
Local time
6:15 AM
Posts
4
Location
Canada
OS
Windows 11 ARM64
I am running a Windows 11 ARM64 OS and need to clean up the C:\Windows\WinSxS\Temp\InFlight folder. I have tried windows Cleanup and all the DISM commands I can find. But so far no luck. Any help would be greatly appreciated.
I have tried Dism.exe /online /Cleanup-Image /StartComponentCleanup & Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase, But the folder remain.
 

My Computer

System One

  • OS
    Windows 11 ARM64
    Computer type
    Laptop
    Manufacturer/Model
    Microsoft Surface Pro 11
Those folders can't be cleaned up using DISM commands.

@Tester wrote a PowerShell script to safely clean them up.
C:\Windows\WinSxS\Temp\InFlight\ Deleting Empty Folders

It's attached below for your convenience. Run this command as Admin:
Code:
powershell -ep bypass -f .\WinSxSDeleteEmptyInFlightFolders.ps1
 

Attachments

My Computer

System One

  • OS
    Windows 7
Please excuse my lack of knowledge but where do I copy the WinSxSDeleteEmptyInFlightFolders.ps1 file to any special folder / location and how do I get the "powershell -ep bypass -f .\WinSxSDeleteEmptyInFlightFolders.ps1" to run as administrator? I am logged in as an admin.
 

My Computer

System One

  • OS
    Windows 11 ARM64
    Computer type
    Laptop
    Manufacturer/Model
    Microsoft Surface Pro 11
I think I figured it out
1. Copy the "WinSxSDeleteEmptyInFlightFolders.ps1" file to C:\Tmp
2. Open Command Prompt as Admin
3. Change to C:\Tmp directory
4. Run "powershell -ep bypass -f .\WinSxSDeleteEmptyInFlightFolders.ps1"

It seams to have worked for me.
Thanks very much
 

My Computer

System One

  • OS
    Windows 11 ARM64
    Computer type
    Laptop
    Manufacturer/Model
    Microsoft Surface Pro 11

Latest Support Threads

Back
Top Bottom