BCUninstaller/Bulk-Crap-Uninstaller · error · IOException
Dism returned error code
Error message
Dism returned error code
What it means
RunDismCommand starts dism.exe, reads its stdout, and checks the exit code. Any non-zero code triggers IOException whose message names the code and whose InnerException carries the relevant DISM output snippet (located by searching for the code in the text). The caller can inspect the inner exception for DISM's own error description.
Source
Thrown at source/KlocTools/IO/DismTools.cs:90
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = false,
CreateNoWindow = true,
StandardOutputEncoding = Encoding.GetEncoding(850)
};
var process = Process.Start(psi);
Debug.Assert(process != null);
var output = process.StandardOutput.ReadToEnd();
process.WaitForExit();
if (process.ExitCode != 0)
{
var code = process.ExitCode.ToString();
var index = output.IndexOf(code, StringComparison.InvariantCulture);
throw new IOException("Dism returned error code " + code,
new Exception(index > 0 ? output.Substring(index + code.Length).Trim() : output));
}
return output;
}
public static WindowsFeatureInfo GetFeatureInfo(string featureName)
{
var output = RunDismCommand("/english /format:list /online /get-featureinfo /featurename=" +
'\"' + featureName + '\"');
return FromDismOutput(output);
}
public static string GetDismUninstallString(string featureName, bool silent)
{
return string.Format("Dism.exe /norestart {1}/online /disable-feature /featurename=\"{0}\"",
featureName, silent ? "/quiet " : string.Empty);
}View on GitHub (pinned to 608321de98)
Solutions
- Run BCU as administrator.
- Address the specific DISM error (e.g. run sfc /scannow or DISM /RestoreHealth).
- Reboot to clear a pending operation, then retry.
- Verify the feature name actually exists on this image.
Defensive patterns
Strategy: try-catch
Try / catch
try { return DismTools.GetFeatureInfo(name); }
catch (IOException ex) { var dismMsg = ex.InnerException?.Message; /* handle */ } Prevention
- Run DISM-based operations elevated.
- Handle pending-reboot and component-store errors explicitly.
When it happens
Trigger: DISM fails due to a missing feature name, corrupted component store, pending reboot, access denied, or unsupported operation.
Common situations: Querying a feature that does not exist; component-store corruption; a pending reboot blocking the operation; running non-elevated.
Related errors
- Dism output has invalid format
- regedit.exe returned error code: {pr.ExitCode}
- Not a Windows .exe file.
- Win32_Directory.Compress returned {ret}
- Process name can't be null or empty
AI-assisted analysis of BCUninstaller/Bulk-Crap-Uninstaller@608321de98 (2026-08-13).
Data as JSON: /api/errors/bb35039666b5a8b5.
Report an issue: GitHub.