BCUninstaller/Bulk-Crap-Uninstaller · error · TimeoutException
WMI query has hung while collecting Windows Features, try re
Error message
WMI query has hung while collecting Windows Features, try restarting your computer. If the error persists read the KB957310 article.
What it means
A TimeoutException thrown by WindowsFeatureFactory when the background WMI feature-enumeration thread is still alive after `t.Join(TimeSpan.FromSeconds(40))`. The WMI query did not throw but also did not complete within 40 seconds, so it is treated as hung. The message directs the user to restart the machine or consult KB957310. Thread abort is intentionally commented out (unsafe), so the thread is abandoned.
Source
Thrown at source/UninstallTools/Factory/WindowsFeatureFactory.cs:48
results.AddRange(WmiQueries.GetWindowsFeatures()
.Where(x => x.Enabled)
.Select(WindowsFeatureToUninstallerEntry));
}
catch (Exception ex)
{
error = ex;
}
});
t.Start();
t.Join(TimeSpan.FromSeconds(40));
if (error != null)
throw new IOException("Error while collecting Windows Features. If Windows Update is running wait until it finishes and try again. If the error persists try restarting your computer. In case nothing helps, read the KB957310 article.", error);
if (t.IsAlive)
{
//t.Abort();
throw new TimeoutException("WMI query has hung while collecting Windows Features, try restarting your computer. If the error persists read the KB957310 article.");
}
return results;
}
private static ApplicationUninstallerEntry WindowsFeatureToUninstallerEntry(WindowsFeatureInfo info)
{
var displayName = !string.IsNullOrEmpty(info.DisplayName) ? info.DisplayName : info.FeatureName;
return new ApplicationUninstallerEntry
{
RawDisplayName = displayName,
Comment = info.Description,
UninstallString = DismTools.GetDismUninstallString(info.FeatureName, false),
QuietUninstallString = DismTools.GetDismUninstallString(info.FeatureName, true),
UninstallerKind = UninstallerType.WindowsFeature,
Publisher = "Microsoft Corporation",
IsValid = true,
View on GitHub (pinned to 608321de98)
Solutions
- Restart the computer to reset the WMI service and servicing stack.
- Run `sfc /scannow` and `DISM /Online /Cleanup-Image /RestoreHealth` to repair corruption.
- If WMI is the culprit, salvage the repository: `winmgmt /salvagerepository` then `winmgmt /resetrepository`.
- Ensure no Windows Update is mid-installation, then retry feature collection.
- Consult KB957310 for persistent Windows Features tooling failures.
Defensive patterns
Strategy: fallback
Try / catch
try { var features = WindowsFeatureFactory.GetFeatures(); }
catch (TimeoutException ex) when (ex.Message.Contains("WMI query has hung"))
{ /* warn user, restart machine, salvage WMI repo, or skip features gracefully */ } Prevention
- Treat Windows Features enumeration as best-effort with a graceful skip.
- Run `winmgmt /salvagerepository`/`/resetrepository` when WMI hangs recur.
- Repair the component store with DISM to prevent servicing hangs.
- Avoid launching feature collection while Windows Update is mid-install.
When it happens
Trigger: The WMI query for Windows Features hangs indefinitely — common when the WMI service is deadlocked, the CBS/servicing stack is stuck waiting on Windows Update, or a corrupted repository causes the query to never return.
Common situations: WMI repository corruption causing queries to hang; servicing stack locked by a stuck Windows Update; system under heavy disk/CPU load slowing WMI past 40s; third-party security software blocking WMI calls.
Related errors
- Error while collecting Windows Features. If Windows Update i
- Win32_Directory.Compress returned {ret}
- regedit.exe failed to execute properly
- Invalid path {item.Command}
- Expected string or array token but got {reader.TokenType}
AI-assisted analysis of BCUninstaller/Bulk-Crap-Uninstaller@608321de98 (2026-08-13).
Data as JSON: /api/errors/d3193ebc9253a799.
Report an issue: GitHub.