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{oldPath} What it means
Thrown in the enable flow when restoring a previously disabled file-based StartupEntry: GetDisabledEntryPath returns the backup location oldPath, and if File.Exists(oldPath) is false the code throws InvalidOperationException with StartupManager_FailedEnable_FileNotFound plus oldPath. The backup file that the disable step created is required to move the entry back to its original location.
Source
Thrown at source/UninstallTools/Startup/Normal/OldStartupDisable.cs:205
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);
if (File.Exists(oldPath))
{
File.Delete(startupEntry.FullLongName);
File.Move(oldPath, startupEntry.FullLongName);
}
else
throw new InvalidOperationException(Localisation.StartupManager_FailedEnable_FileNotFound
+ "\n\n" + oldPath);
}
else
{
// Recreate the registry key
StartupEntryManager.CreateRegValue(startupEntry);
}
Delete(startupEntry);
startupEntry.BackupPath = string.Empty;
// Entry is no longer disabled
startupEntry.DisabledStore = false;
}
/// <summary>
/// Create backup store path for the link. The backup extension is appended as well.
/// Works only for links, returns garbage for registry values.
View on GitHub (pinned to 608321de98)
Solutions
- Before calling Enable, check File.Exists(GetDisabledEntryPath(entry)) and, if missing, recreate the entry from a known-good source or recreate the startup shortcut directly.
- Verify the backup volume is mounted and the path in BackupPath still resolves.
- Treat a missing backup as a recovery case: log it, recreate the startup registration manually, and clear DisabledStore.
Example fix
// before
_disableService.Enable(entry);
// after
var backupPath = GetDisabledEntryPath(entry);
if (!File.Exists(backupPath))
{
StartupEntryManager.CreateRegValue(entry); // or recreate shortcut
entry.DisabledStore = false;
return;
}
_disableService.Enable(entry); Defensive patterns
Strategy: validation
Validate before calling
var backup = disableService.GetDisabledEntryPath(entry);
if (!entry.IsRegKey && entry.DisabledStore && !File.Exists(backup))
{
// backup gone: recreate the registration directly
StartupEntryManager.CreateRegValue(entry);
entry.DisabledStore = false;
return;
}
disableService.Enable(entry); Type guard
null
Try / catch
try { disableService.Enable(entry); }
catch (InvalidOperationException ex) when (ex.Message.Contains(Localisation.StartupManager_FailedEnable_FileNotFound))
{
StartupEntryManager.CreateRegValue(entry);
entry.DisabledStore = false;
} Prevention
- Verify the backup volume is still mounted before enabling.
- Never set DisabledStore=true unless the File.Move in Disable actually succeeded.
- Keep backups off temp drives that get cleared on reboot.
When it happens
Trigger: Calling Enable on a StartupEntry whose DisabledStore is true but whose backup file (on DriveDisableBackupPath) has been deleted, moved, or is on a volume that is no longer mounted.
Common situations: The user manually cleaned the backup folder; an antivirus quarantined the moved file; the backup was on a temp drive that was cleared; the disable step never actually completed the File.Move but still set DisabledStore=true.
Related errors
- Failed to enable this entry, the following file was not foun
- Invalid path {item.Command}
- File name cannot be empty.
- The uninstall list file is empty.
- The system cannot find the file specified. Indicates that th
AI-assisted analysis of BCUninstaller/Bulk-Crap-Uninstaller@608321de98 (2026-08-13).
Data as JSON: /api/errors/8680a2a12708f556.
Report an issue: GitHub.