Unable to cleanup WINSXS/temp/PendingDeletes

Narve Andreas Nordås 36 Reputation points
2021-02-10T14:34:14.95+00:00

Hi,

On a Server 2012 R2 the WINSXS/temp/PendingDeletes folder contains 52 GB. All are labelled $$DeleteMe...." and are from between 2013 and 2016.

And running the command dism /CleanUp-Image /AnalyzeComponentStore report 25 GB and a cleanup is recommended.

![66573-dism.jpg][1]

But running dism /CleanUp-Image /StartComponentCleanup only last for 3 seconds and nothing happends.

Running DiskCleanup does only remove some 100 MB.

A reboot does not help

How to get rid of all the files in WINSXS/temp/PendingDeletes?

Windows for business | Windows Server | User experience | Other
0 comments No comments
{count} vote

5 answers

Sort by: Most helpful
  1. Teemo Tang 11,486 Reputation points
    2021-02-11T02:04:03.317+00:00

    The command you mentioned is correct
    DISM /online /Cleanup-Image /StartComponentCleanup

    However, for that task to complete, TrustedInstaller must be running, which is not set up by default. To run TrustedInstaller, you may need to first enable TelnetServer, then enter
    net start TrustedInstaller
    source:
    cleanup C:\Windows\WinSxS\Temp\PendingDeletes and PendingRenames
    https://superuser.com/questions/1024441/cleanup-c-windows-winsxs-temp-pendingdeletes-and-pendingrenames
    Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.

    -------------------------------------------------------------------------------------

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Narve Andreas Nordås 36 Reputation points
    2021-02-11T11:44:12.897+00:00

    Thank you for the feedback.
    I did run the needed commands:
    66899-dism-commands.jpg

    But still the PendingDeletes are huge. No files are deleted:
    66955-folder-size.jpg

    What to do?

    0 comments No comments

  3. abbodi86 4,241 Reputation points
    2021-02-11T19:48:24.937+00:00

    Google for NSudo

    NSudo -U:T -P:E cmd /k "del /f /q C:\Windows\WinSxS\Temp\PendingDeletes\*"
    
    0 comments No comments

  4. Narve Andreas Nordås 36 Reputation points
    2021-02-12T10:02:50.14+00:00

    Hi @abbodi86 and thank for your suggestion.

    I get Access denied when I run the command. Both as TrustedInstaller and System:
    67366-nsudo.jpg

    'a rather stubborn folder.
    Any other suggestions?


  5. TK 1 0 Reputation points
    2025-08-26T22:31:07.5666667+00:00

    I take ownership of an orphaned delete me pendingdeletes hard link entry and then go back and add my username with full access rights to the objects security and then I am usually able to delete them... if the file is still in use I use Unlocker shell extension to let me unlock and optionally delete the selected file. I had no joy with Nsudo tool.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.