Skip to content

Instantly share code, notes, and snippets.

@MyITGuy
Last active May 18, 2024 14:27
Show Gist options
  • Save MyITGuy/d7d3bba61038bea4df91482b416b9798 to your computer and use it in GitHub Desktop.
Save MyITGuy/d7d3bba61038bea4df91482b416b9798 to your computer and use it in GitHub Desktop.

ComponentCleanup progress appears to hang.

  • StartComponentCleanup after progress at 100%
  • AnalyzeComponentStore after progress at 17%

Preface

TiWorker.exe is still working. Do not stop the TiWorker.exe process. Instead, analyze its progress, which make take hours...or longer.

Discoveries

  • The system used for this write-up had 3718 subfolders under InFlight.
  • One of the longer folders to process took 91 seconds. Some take much less time, but if all took 91 seconds, it would take nearly 4 days to complete.
  • The \Microsoft\Windows\Servicing\StartComponentCleanup has a timeout of 1 hour.
  • After completion and reboot the InFlight folder had 5270 subfolders.
  • AnalyzeComponentStore is also impacted.
  • AnalyzeComponentStore prompted for a reboot (??). Is it doing more than "analyze"?

Theory

After a "cleanup" new folders are created in the InFlight directory but the old folders are not removed. This causes TiWorker.exe to take exponetially longer each time.

While running the dism.exe command manually gives it time to complete, the scheduled task will never have the time needed to complete.

What to do...

  • Get the folders that are being evaluated by TiWorker.

    $InFlight = Get-ChildItem -Path $env:windir\winsxs\temp\inflight | Select-Object -ExpandProperty Name; (($InFlight.IndexOf((Read-Host "Folder Name"))) / $InFlight.Count) * 100
  • Use Process Monitor from Sysinternals:
    • Filter:
      • Process Name is TiWorker.exe
      • Path contains \winsxs\temp\inflight\
  • Run for a couple seconds to see which folder is being evaluated, then stop (doesn't need to run long).
  • Open the last entry and copy the folder name directly after the "InFlight" folder.
  • Enter the this for the prompt for Folder Name to get the percentage complete.

Example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment