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


Doc396

Member
Local time
12:15 PM
Posts
5
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
    CPU
    Snapdragon(R) X 12-core X1E80100 @ 3.40 GHz 3.42 GHz
    Memory
    64.0 GB (63.5 GB usable)
    Monitor(s) Displays
    Surface laptop & Samsung 30"
    Screen Resolution
    1920 X 1080
    Hard Drives
    500 GB SSD
    Case
    Laptop
    Keyboard
    Logi
    Mouse
    Microsoft Comfort Mouse
    Internet Speed
    Download 24.39 Mb/s
    Browser
    Firefox & Edge
    Antivirus
    Malwarebytes
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
    CPU
    Snapdragon(R) X 12-core X1E80100 @ 3.40 GHz 3.42 GHz
    Memory
    64.0 GB (63.5 GB usable)
    Monitor(s) Displays
    Surface laptop & Samsung 30"
    Screen Resolution
    1920 X 1080
    Hard Drives
    500 GB SSD
    Case
    Laptop
    Keyboard
    Logi
    Mouse
    Microsoft Comfort Mouse
    Internet Speed
    Download 24.39 Mb/s
    Browser
    Firefox & Edge
    Antivirus
    Malwarebytes
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
    CPU
    Snapdragon(R) X 12-core X1E80100 @ 3.40 GHz 3.42 GHz
    Memory
    64.0 GB (63.5 GB usable)
    Monitor(s) Displays
    Surface laptop & Samsung 30"
    Screen Resolution
    1920 X 1080
    Hard Drives
    500 GB SSD
    Case
    Laptop
    Keyboard
    Logi
    Mouse
    Microsoft Comfort Mouse
    Internet Speed
    Download 24.39 Mb/s
    Browser
    Firefox & Edge
    Antivirus
    Malwarebytes
Could you tell me what kind of files you wanted to cleanup? And how did notice that you needed to cleanup that folder?
As this script ofcouse only deleted the EmptyFolders, as the rest of the files should stay. Can you show me how much files and folders there are now in InFlight and how many gb?
Out of curiosity, how many empty folders did it delete?
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
On my main system, that has arrived at W11 24H2 from an upgrade a long time ago from Windows 10, my inflight/temp directory looks like this

Screenshot 2025-06-24 134354.webp

On the other hand, my Dell laptop that was clean-installed 6 months ago on 24H2 looks like this

Screenshot 2025-06-24 134417.webp


Quite a difference.
 

My Computers

System One System Two

  • OS
    Windows 11 Home 24H2 RP
    Computer type
    PC/Desktop
    Manufacturer/Model
    Self-build
    CPU
    Intel I3-10100
    Motherboard
    MSI H410M-PRO
    Memory
    16 GB
    Graphics Card(s)
    Nvidia GT 1030
    Sound Card
    Motherboard default
    Monitor(s) Displays
    Philips 27 inch
    Screen Resolution
    1920x1080
    Hard Drives
    Samsung EVO 970 NVMe SSD 256 Gb
    Samsung QVO 870 SATA SSD 2 Tb
    PSU
    ATX 450W
    Keyboard
    Logitech
    Mouse
    Logitech Wireless
    Internet Speed
    930 Mb down / 120 Mb up
    Browser
    Edge
    Antivirus
    Windows Defender
    Other Info
    Microsoft Office 2021 Plus
  • Operating System
    Windows 11 Home
    Computer type
    PC/Desktop
    Manufacturer/Model
    Self-build
    CPU
    Intel i3-8100
    Motherboard
    Gigabyte Z370 D3
    Memory
    16 Gb
    Graphics card(s)
    Nvidia GT 720
    Sound Card
    Motherboard default
    Monitor(s) Displays
    Philips 27-inch
    Screen Resolution
    1920x1080
    Hard Drives
    Samsung 960 NVMe SSD 256 Gb
    Seagate 2 Tb HDD
    PSU
    ATX 450W
    Mouse
    Logitech Wireless
    Keyboard
    Microsoft
    Internet Speed
    930 Mb down / 120 Mb up
    Browser
    Edge
    Antivirus
    Windows Defender

My Computers

System One System Two

  • OS
    Windows 11 Pro/All Channels
    Computer type
    Laptop
    Manufacturer/Model
    Acer Nitro ANV15-51
    CPU
    AMD Ryzen 7 7735HS 3200-4500 Mhz 8 cores x 2
    Motherboard
    Sportage_RBH
    Memory
    32 GB DDR5
    Graphics Card(s)
    Radeon Graphic / NVIDIA GeForce RTX 4060 8 GB GDDR6
    Sound Card
    AMD/Realtek(R) Audio
    Monitor(s) Displays
    Integrated Monitor (15.3"vis)
    Screen Resolution
    FHD 1920X1080 16:9 144Hz
    Hard Drives
    Kingston OM8SEP4512Q 500 GB
    WDS500G2B0A-00SM50 500.1 GB
    PSU
    19V DC 6.32 A 120 W
    Cooling
    Dual Fans
    Mouse
    MS Bluetooth
    Internet Speed
    Fiber 1GB Cox -us & IGB Orange-fr
    Browser
    Edge Canary- Firefox Nightly-Chrome Dev-Chrome Dev
    Antivirus
    Windows Defender
    Other Info
    VMs of Windows 11 stable/Beta/Dev/Canary
    VM of XeroLinux- Arch based & Debian 13 (Trixie)
  • Operating System
    Windows 11 Insider Canary
    Computer type
    Laptop
    Manufacturer/Model
    ASUS X751BP
    CPU
    AMD Dual Core A6-9220
    Motherboard
    ASUS
    Memory
    8 GB
    Graphics card(s)
    AMD Radeon R5 M420
    Sound Card
    Realtek
    Monitor(s) Displays
    17.3
    Screen Resolution
    1600X900 16:9
    Hard Drives
    1TB 5400RPM
about 6,000 deleted on my Windows 11 ARM 64 sstem
 

My Computer

System One

  • OS
    Windows 11 ARM64
    Computer type
    Laptop
    Manufacturer/Model
    Microsoft Surface Pro 11
    CPU
    Snapdragon(R) X 12-core X1E80100 @ 3.40 GHz 3.42 GHz
    Memory
    64.0 GB (63.5 GB usable)
    Monitor(s) Displays
    Surface laptop & Samsung 30"
    Screen Resolution
    1920 X 1080
    Hard Drives
    500 GB SSD
    Case
    Laptop
    Keyboard
    Logi
    Mouse
    Microsoft Comfort Mouse
    Internet Speed
    Download 24.39 Mb/s
    Browser
    Firefox & Edge
    Antivirus
    Malwarebytes
Back
Top Bottom