BCUninstaller/Bulk-Crap-Uninstaller · error · ArgumentException

Could not find a tweak with this name to uninstall

Error message

Could not find a tweak with this name to uninstall

What it means

Thrown by ScriptHelper's Main when, in the 'uninstall' command branch, Tweaks.GetEntry(_appId) returns null - i.e. no tweak is registered under the supplied id. It is an ArgumentException, caught by the generic handler which maps it to an unexpected-error return code (ResultWin32.ERROR_UNEXP_NET_ERR), so the process exits non-zero.

Source

Thrown at source/ScriptHelper/Program.cs:33

    {
        private static QueryType _queryType;
        private static string _appId;

        [STAThread]
        private static int Main(string[] args)
        {
            HelperTools.SetupEncoding();

            try
            {
                ProcessCommandlineArguments(args);

                switch (_queryType)
                {
                    case QueryType.Uninstall:
                        Console.WriteLine("Uninstalling " + _appId);
                        var tweakEntry = Tweaks.GetEntry(_appId);
                        if (tweakEntry == null) throw new ArgumentException("Could not find a tweak with this name to uninstall");
                        tweakEntry.OnUninstall(true);
                        break;
                    case QueryType.List:
                        foreach (var result in Tweaks.GetConsoleOutput())
                        {
                            var converted = result.Select(x => new KeyValuePair<string, object>(x.Key, x.Value)).ToList();
                            Console.WriteLine(HelperTools.KeyValueListToConsoleOutput(converted));
                        }
                        break;
                    default:
                        Console.WriteLine("Accepted commands:\nlist\nuninstall <id>");
                        break;
                }
            }
            catch (OperationCanceledException)
            {
                return (int)ResultWin32.ERROR_CANCELLED;
            }

View on GitHub (pinned to 608321de98)

Solutions

  1. Run 'ScriptHelper list' first and use one of the ids it prints.
  2. Confirm the ScriptHelper build matches the version that registered the tweak id you are passing.
  3. Wrap the call and treat a non-zero exit / ArgumentException as 'already removed' if re-running an uninstall script.

Example fix

// before
ScriptHelper.exe uninstall MyAppTweakId
// -> 'Could not find a tweak with this name to uninstall'

// after
ScriptHelper.exe list
# pick a real id from the output, then:
ScriptHelper.exe uninstall <real-id>
Defensive patterns

Strategy: validation

Validate before calling

// Before invoking ScriptHelper, confirm the id is in its list output.
var ids = RunScriptHelper("list").ParseIds();
if (!ids.Contains(appId, StringComparer.OrdinalIgnoreCase))
    return; // nothing to uninstall

Try / catch

try { Tweaks.GetEntry(_appId)?.OnUninstall(true); }
catch (ArgumentException ex) when (ex.Message.Contains("Could not find a tweak"))
{ /* id not registered; log and treat as already uninstalled */ }

Prevention

When it happens

Trigger: Running 'ScriptHelper uninstall <id>' where <id> is not a tweak id that Tweaks.GetEntry recognizes; passing the display name instead of the internal id; the tweak list changed and the id was removed or renamed.

Common situations: Calling the helper with a stale id read from an older config; typos in the id string; version mismatch between the host application's stored ids and the ScriptHelper build's compiled tweak set.

Related errors


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