ERROR_FILE_NOT_FOUND (0x00000002)

Fix ERROR_FILE_NOT_FOUND (0x2) on Windows Update & Stubborn Files

This error pops up when Windows Update or file deletion hits a broken path. Here's how to clear it fast and stop it coming back.

Yeah, that error is a pain—you're mid-update or trying to nuke a leftover file, and Windows just shrugs with "The system cannot find the file specified." Let's cut the chatter and get it fixed.

The Fix That Works for Most People: Clean Up Those Update Files

The usual culprit is a corrupted Windows Update cache or a pending update that's pointing at a file that's already gone. Here's what I do on every machine that walks in with this error:

  1. Stop the Windows Update service. Open Command Prompt as Administrator and run:
    net stop wuauserv
  2. Also stop the Background Intelligent Transfer Service (BITS):
    net stop bits
  3. Delete the SoftwareDistribution folder—that's where the cached updates live. Don't worry, it'll rebuild itself.
    rd /s /q C:\Windows\SoftwareDistribution
  4. Restart the services:
    net start wuauserv
    net start bits

Now try Windows Update again. Ran into this just last month with a client's POS system—same error, and this cleared it in under two minutes. If it's still throwing the error, move on to the next step.

If That Didn't Stick, Try the Disk Cleanup Trick

Sometimes a leftover update file is locked. The built-in Disk Cleanup tool can often rip it out where the command line fails.

  1. Type cleanmgr in Start and run it.
  2. Select your system drive (usually C:).
  3. Click Clean up system files.
  4. Check Windows Update Cleanup and Temporary files.
  5. Let it run—this might take a few minutes on older drives.

That alone fixed a stubborn error for a user who couldn't install the October 2023 cumulative update on Windows 11 22H2. Took longer to boot the machine than to fix it.

Why This Works: The Root Cause

The error 0x00000002 means the system is looking for a file path that doesn't exist—or a registry entry pointing to a ghost. When Windows Update runs, it checks a list of pending updates. If one of those points to a file that was deleted or never fully downloaded, you get this exact error. Deleting the cache forces Windows to rebuild that list from scratch.

For stubborn files you're trying to delete manually, same deal. The file's metadata is still in the filesystem, but the actual data blocks are gone. Windows tries to access them, fails, and throws ERROR_FILE_NOT_FOUND. The fix there is to bypass the normal delete path.

Deleting a Stubborn File: The Direct Approach

If you're getting this error when trying to delete a file or folder, try these in order:

  1. Take ownership first. Right-click the file, go to Properties → Security → Advanced, and set yourself as owner. Then try deleting.
  2. If that fails, use the command line with the \\.\ prefix—it bypasses some of the filesystem checks:
    del \\?\C:\Users\YourName\Desktop\stubbornfile.txt
  3. Still stuck? Boot into Safe Mode and delete it from there. Safe Mode doesn't load third-party drivers that might be locking the file.

Less Common Variations: When the Usual Fix Doesn't Cut It

Sometimes the error isn't about Update at all. Here are the two other spots I've seen it pop up:

Registry Entries Pointing to Nothing

If you're getting this error when starting a program or service, a registry entry might reference a DLL or EXE that's been moved or uninstalled. The quick check:

  1. Open Regedit.
  2. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run.
  3. Look for any entry pointing to a path that doesn't exist. Delete it.

I had a client whose antivirus left a startup entry after uninstall—every boot threw this error in Event Viewer. One delete key fixed it.

Pending.xml Corruption

This is a nasty one. The C:\Windows\WinSxS\pending.xml file tracks pending component-based servicing operations. If it's corrupted, updates fail with this exact error. Fix is to delete it, but you'll need to take ownership first:

takeown /f C:\Windows\WinSxS\pending.xml
icacls C:\Windows\WinSxS\pending.xml /grant administrators:F
del C:\Windows\WinSxS\pending.xml

Then restart and try updates again. This is a last-resort—I've only needed it twice in the last five years, but both times it was the only thing that worked.

How to Prevent This From Coming Back

Most of these issues trace back to interrupted updates or third-party tools messing with system files. Here's what I tell every client:

  • Never force-quit Windows Update. Let it finish, even if it takes an hour.
  • Run sfc /scannow monthly. It checks system file integrity and catches corruption early.
  • Keep at least 10% of your system drive free. Windows Update needs room to juggle files.
  • Uninstall programs properly—use the uninstaller, don't just delete folders.

That's it. You're back up and running, and next time you see that error, you'll know exactly where to hit it.

Related Errors in Windows Errors
0XC0000308 0XC0000308: DVD copy protection session key missing 0XC000000B STATUS_INVALID_CID 0xC000000B: Fix It Now 0XC026232C 0XC026232C: Monitor descriptor not in set fix 0XC015000F STATUS_SXS_EARLY_DEACTIVATION (0XC015000F) Fix

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.