0X00000498

Fix ERROR_UNABLE_TO_MOVE_REPLACEMENT (0X00000498)

Windows Errors Intermediate 👁 0 views 📅 May 26, 2026

File replacement fails because another process locks the target. Usually antivirus or the file itself is in use. Kill the lock and it's done.

1. File locked by another process — the real culprit

I've seen this error hundreds of times. 90% of the time, the file you're trying to replace is locked by an open handle. Could be an app you forgot to close, a service, or even Explorer itself. Windows won't let you swap a file that's in use.

Don't bother with sfc /scannow or chkdsk — they rarely fix this. The fix is finding what's holding the file and killing it.

Use Process Explorer to find the lock

Microsoft's Process Explorer (from Sysinternals) is your best tool here. Grab it from the official site — it's free and lightweight.

  1. Run Process Explorer as Administrator.
  2. Press Ctrl+F to open the Find Handle or DLL dialog.
  3. Type the name of the file you can't replace (or part of it) and hit Search.
  4. Process Explorer shows every process holding a handle to that file.
  5. Double-click the offending process, then close or kill it from the Process tab.
  6. Try your file replacement again.

If you can't kill the process because it's critical (e.g., svchost.exe), you can close the handle directly from the search results — right-click the handle and select Close Handle. Use this carefully, and only if you know what you're doing.

Use Handle.exe from command line (script-friendly)

For remote machines or automation, use the command-line version handle.exe. Run this as admin:

handle.exe -a -u "C:\path\to\lockedfile.dll"

It returns something like:

winword.exe pid: 1234 type: File 1F4: C:\path\to\lockedfile.dll

Then kill the process with taskkill /PID 1234 /F. Check if the file is free, then retry.

2. Antivirus or security software blocking the replacement

Second most common cause — your antivirus (Windows Defender, McAfee, Symantec, CrowdStrike) thinks the replacement file is suspicious. It locks the target file during a scan or prevents the write operation entirely.

This happens a lot during patch deployments when you're swapping DLLs or EXEs. The AV sees a newer binary and either holds a scan lock or blocks the write thinking it's a ransomware-like behavior.

Quick test: disable real-time protection temporarily

For Windows Defender:

  1. Open Windows Security.
  2. Go to Virus & threat protection > Manage settings.
  3. Turn off Real-time protection. It'll re-enable after a reboot automatically.
  4. Attempt the file replacement.
  5. If it works, add the folder or file extension to the exclusion list.

For third-party AV, check their documentation on adding exclusions. Common paths to exclude:

  • C:\Windows\System32\ (be careful — only specific files)
  • Your deployment share or temp directory
  • File extensions like .dll, .exe, .sys

Don't leave real-time protection off for long. Re-enable it right after the fix.

3. Permissions or ownership issues (rare but worth checking)

If neither a lock nor AV is the problem, check file permissions. The account performing the replacement needs Full Control over both the target file and the replacement file.

Common scenario: you're replacing a system file owned by TrustedInstaller with an account that only has SYSTEM rights. You'll get this error.

Check and fix permissions

  1. Right-click the target file > Properties > Security tab.
  2. Click Advanced. Look at the Owner. If it's TrustedInstaller or SYSTEM, you need to take ownership.
  3. Click Change next to Owner. Type your username or Administrators, click Check Names, then OK.
  4. Grant your account Full Control via the Permissions list.
  5. Apply to all child objects if it's a folder.
  6. Try the replacement again.

You can do this faster from an admin command prompt:

takeown /f "C:\path\to\file.dll"
icacls "C:\path\to\file.dll" /grant "%USERNAME%":F

Then retry the move.

4. Corrupted or fragmented file system (last resort)

I've only seen this 2-3 times. The file system itself is busted — bad sectors on disk or a corrupt NTFS MFT entry. The OS can't complete the rename or replace because the metadata is hosed.

Run a checkdisk:

chkdsk C: /f /r

You'll need a reboot. If chkdsk finds and fixes errors, try the replacement again. If the file still errors out, copy the replacement to a different disk location, then move it to the target path. That bypasses the corrupt metadata in some cases.

Quick-reference summary table

Cause Symptoms Fix Time to resolve
File locked by process Error appears when file is open in an app or service Use Process Explorer or Handle.exe to find and kill the lock 2-5 minutes
Antivirus blocking Error on deployment/patch, especially with DLL/EXE Disable real-time AV temporarily, then add exclusion 5-10 minutes
Permissions/ownership Occurs with system files, access denied errors Take ownership with takeown, grant Full Control with icacls 5 minutes
Corrupt file system Persistent errors after fixes above, disk warnings Run chkdsk /f /r, then retry 30+ minutes

Start with the first cause — it's the most common by far. You'll fix 9 out of 10 cases right there.

Was this solution helpful?