BCUninstaller/Bulk-Crap-Uninstaller · error · FormatException

No commands specified

Error message

No commands specified

What it means

A FormatException raised after the ScriptHelper argument loop completes when `_queryType` is still `QueryType.None`. It means none of the recognized command tokens (uninstall, l, list) was present, so there is nothing for the helper to do. The check exists to fail explicitly rather than silently no-op.

Source

Thrown at source/ScriptHelper/Program.cs:91

                        if (_queryType != QueryType.None) throw new FormatException(@"Multiple commands specified");
                        _queryType = QueryType.Uninstall;
                        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. Always include a command token: `ScriptHelper uninstall <id>` or `ScriptHelper list`.
  2. Check for supported command names before assembling the command line.
  3. Add a usage/help check in the calling script when no command is supplied.

Example fix

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

Strategy: validation

Validate before calling

var commands = new[] { "uninstall", "list", "l" };
if (!args.Any(a => commands.Contains(a, StringComparer.OrdinalIgnoreCase)))
    throw new ArgumentException("No command specified. Use uninstall or list.");

Try / catch

try { /* invoke ScriptHelper */ }
catch (FormatException ex) when (ex.Message.Contains("No commands specified"))
{ /* prompt user for a command and retry */ }

Prevention

When it happens

Trigger: Running `ScriptHelper <appId>` with an app identifier but no command, or `ScriptHelper` with no arguments at all, or passing only unrecognized tokens that all fall into the default case.

Common situations: Caller scripts that prepend the app ID but forget the verb; typos like `unintall`; environment where the command token was stripped by a wrapper.

Related errors


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