BCUninstaller/Bulk-Crap-Uninstaller · error · IOException

Failed to open control panel entry

Error message

Failed to open control panel entry

What it means

Thrown by OpenControlPanelApplet as a catch-all when starting the control panel executable (CplPath with /name Microsoft.<target>) fails for any reason. The original exception is preserved as InnerException. The helper uses UseShellExecute=true, so failures typically come from the shell association, the canonical name, or policy.

Source

Thrown at source/KlocTools/Tools/WindowsTools.cs:463

                return true;
            }
            return false;
        }

        /// <summary>
        ///     Open target control panel applet and return immidiately.
        /// </summary>
        /// <exception cref="IOException">Failed to open control panel entry</exception>
        public static void OpenControlPanelApplet(ControlPanelCanonicalNames target)
        {
            try
            {
                new ProcessStartInfo(CplPath, "/name Microsoft." + target) { UseShellExecute = true }.Start();
            }
            catch (Exception ex)
            {
                throw new IOException("Failed to open control panel entry", ex);
            }
        }

        /// <exception cref="ArgumentNullException">The value of 'objectPath' cannot be null. </exception>
        /// <exception cref="IOException">Failed to start explorer. </exception>
        public static void OpenExplorerFocusedOnObject(string objectPath)
        {
            if (objectPath == null)
            {
                throw new ArgumentNullException(nameof(objectPath));
            }
            try
            {
                new ProcessStartInfo("explorer.exe", string.Format("/select,\"{0}\"", objectPath)).Start();
            }
            catch (ArgumentNullException)
            {
                throw;

View on GitHub (pinned to 608321de98)

Solutions

  1. Catch the IOException and inspect InnerException (often Win32Exception with a native error code) to pinpoint the cause.
  2. Confirm the target canonical name is valid for the running Windows edition.
  3. Verify control.exe is reachable (CplPath) and not blocked by policy.
  4. On Server Core or LTSC without the Control Panel, offer an alternate settings deep-link instead.

Example fix

// before
WindowsTools.OpenControlPanelApplet(target);

// after
try { WindowsTools.OpenControlPanelApplet(target); }
catch (IOException ex)
{
    Log.Error($"Could not open {target}", ex.InnerException ?? ex);
    Process.Start("ms-settings:");
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (!File.Exists(WindowsTools.CplPath))
    return; // control.exe missing; do not attempt

Try / catch

try { WindowsTools.OpenControlPanelApplet(target); }
catch (IOException ex)
{
    var root = ex.InnerException ?? ex;
    Log.Error($"Could not open {target}: {root.Message}");
}

Prevention

When it happens

Trigger: Passing a ControlPanelCanonicalNames value that does not map to an installed applet; CplPath being unset or pointing at a missing control.exe; group policy disabling the item; shell associations broken so UseShellExecute cannot resolve the .cpl/.exe.

Common situations: Opening an applet not present on the Windows edition (e.g. an older applet on Windows 11); stripped-down images without control.exe; corporate policy 'Hide specified Control Panel items'; user-changed file associations for .cpl.

Related errors


AI-assisted analysis of BCUninstaller/Bulk-Crap-Uninstaller@608321de98 (2026-08-13). Data as JSON: /api/errors/e9516c8d402f8f16. Report an issue: GitHub.