BCUninstaller/Bulk-Crap-Uninstaller · error · FormatException

Missing ID parameter for what to uninstall

Error message

Missing ID parameter for what to uninstall

What it means

A FormatException raised after parsing when `_queryType == QueryType.Uninstall` but `_appId` is still null. Uninstall requires a target identifier; without it the operation is ambiguous and is rejected before any uninstall logic runs.

Source

Thrown at source/ScriptHelper/Program.cs:93

                        break;

                    case @"l":
                    case @"list":
                        if (_queryType != QueryType.None) throw new FormatException(@"Multiple commands specified");
                        _queryType = QueryType.List;
                        break;

                    default:
                        if (_appId != null) throw new FormatException(@"Too many parameters");
                        _appId = arg;
                        break;
                }
            }

            if (_queryType == QueryType.None)
                throw new FormatException(@"No commands specified");
            if (_queryType == QueryType.Uninstall && _appId == null)
                throw new FormatException(@"Missing ID parameter for what to uninstall");
        }

        private enum QueryType
        {
            None,
            Uninstall,
            List,
        }
    }
}

View on GitHub (pinned to 608321de98)

Solutions

  1. Supply the app identifier after the uninstall command: `ScriptHelper uninstall <id>`.
  2. Check that the id variable is non-empty in the calling script before invoking.
  3. Fall back to `ScriptHelper list` first to obtain the correct id.

Example fix

// before
ScriptHelper uninstall
// after
ScriptHelper uninstall 123
Defensive patterns

Strategy: validation

Validate before calling

if (command == "uninstall" && string.IsNullOrWhiteSpace(appId))
    throw new ArgumentException("Uninstall requires an app id.");

Try / catch

try { /* invoke ScriptHelper uninstall */ }
catch (FormatException ex) when (ex.Message.Contains("Missing ID"))
{ /* resolve the id first (e.g. via list) then retry */ }

Prevention

When it happens

Trigger: Running `ScriptHelper uninstall` with no positional app identifier following the command token.

Common situations: Caller script that builds the uninstall command from a variable that was empty/null; forgetting to append the id after the verb.

Related errors


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