BCUninstaller/Bulk-Crap-Uninstaller · error · InvalidOperationException

Failed to enable this entry, the following file was not foun

Error message

Failed to enable this entry, the following file was not found:\n\n{startupEntry.FullLongName}

What it means

Thrown in the file-based startup-disable flow when disabling a non-registry StartupEntry: the code checks File.Exists(startupEntry.FullLongName) and, if false, throws InvalidOperationException with StartupManager_FailedEnable_FileNotFound plus the missing path. The disable path needs to move the startup file to a backup location (DriveDisableBackupPath); if the source file is gone the move cannot proceed.

Source

Thrown at source/UninstallTools/Startup/Normal/OldStartupDisable.cs:179

                {
                    startupEntry.Delete();
                }
                catch
                {
                    // Key doesn't exist
                }
            }
            else
            {
                if (File.Exists(startupEntry.FullLongName))
                {
                    File.Delete(newPath);
                    Directory.CreateDirectory(DriveDisableBackupPath);
                    File.Move(startupEntry.FullLongName, newPath);
                    startupEntry.BackupPath = newPath;
                }
                else
                    throw new InvalidOperationException(Localisation.StartupManager_FailedEnable_FileNotFound
                                                        + "\n\n" + startupEntry.FullLongName);
            }

            CreateDisabledEntry(startupEntry, newPath);

            startupEntry.DisabledStore = true;
        }

        public void Enable(StartupEntry startupEntry)
        {
            if (!startupEntry.DisabledStore)
                return;

            // Reconstruct the startup entry
            if (!startupEntry.IsRegKey)
            {
                // Move the backup file back to its original location
                var oldPath = GetDisabledEntryPath(startupEntry);

View on GitHub (pinned to 608321de98)

Solutions

  1. Before disabling, verify File.Exists(startupEntry.FullLongName) and skip/remove the entry if the file is gone (the registration is already effectively dead).
  2. Refresh the startup entry list before acting so stale entries are pruned.
  3. Resolve FullLongName to a long path (Path.GetFullPath) before the existence check to avoid 8.3 name mismatches.

Example fix

// before
disableService.Disable(entry);

// after
if (!entry.IsRegKey && !File.Exists(entry.FullLongName))
{
    // file already gone; just drop the registration
    StartupEntryManager.RemoveEntry(entry);
    return;
}
disableService.Disable(entry);
Defensive patterns

Strategy: validation

Validate before calling

if (!entry.IsRegKey && !File.Exists(entry.FullLongName))
{
    StartupEntryManager.RemoveEntry(entry); // registration is already dead
    return;
}
disableService.Disable(entry);

Type guard

null

Try / catch

try { disableService.Disable(entry); }
catch (InvalidOperationException ex) when (ex.Message.Contains(Localisation.StartupManager_FailedEnable_FileNotFound))
{
    StartupEntryManager.RemoveEntry(entry);
}

Prevention

When it happens

Trigger: Calling the disable routine on a StartupEntry whose FullLongName points to a file that does not exist on disk — the startup shortcut/binary was deleted by another uninstaller, moved, or the path is on a removable drive that is no longer attached.

Common situations: A previous uninstall removed the binary but left the startup registration; the entry's path is stale; the file lives on a network/USB drive that is disconnected; path stored with a short (8.3) name that no longer resolves.

Related errors


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