Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Cannot Delete File From External Hard Drive? Fixes

· 6 min read · Home Tech

In this article
  1. Why Files Get Stuck on External Drives
  2. First: Close Programs and Unlock the File
  3. Check the Physical Write-Protect Switch
  4. Fix File Permissions (Windows and Mac)
  5. Run a Disk Check to Repair File System Errors
  6. When All Else Fails: Use a Live Linux Boot or Command Line
  7. Frequently Asked Questions

If you cannot delete a file from an external hard drive, the cause is usually a locked file handle, a permissions issue, a corrupted file system, or the drive being write-protected. The fixes below cover all four, starting with the simplest and most common solutions.

Why Files Get Stuck on External Drives

External drives are more prone to deletion failures than internal ones because they are frequently unplugged, shared between computers, and formatted with file systems that handle permissions differently. When you try to delete a file and Windows says it is "open in another program" or "you need permission," the drive itself is usually fine—the problem is that something is still using the file, or the drive's file system has a small error.

Another common cause is a hardware write-protect switch on the drive enclosure. Many external drives, especially older USB models, have a small physical switch that locks the drive. If it is in the locked position, every delete or write operation will fail, even if you are the administrator.

First: Close Programs and Unlock the File

The most frequent reason a file cannot be deleted is that a program still has it open. This can be a media player, a photo viewer, a word processor, or even a background process like a cloud sync client or antivirus scanner. Try these steps in order:

  • Close all open applications, especially ones that might be reading the drive (music players, video editors, file explorers).
  • If you have a cloud sync folder on the drive (OneDrive, Dropbox, Google Drive), pause sync or quit the app.
  • Restart your computer. This releases all file handles and is the single most effective fix.
  • If the file is still stuck after a restart, use the built-in Disk Management tool to check if the drive is healthy.

If a restart does not work, the file handle may be held by a system process. You can use the free Microsoft tool Process Explorer (from Sysinternals) to find which process has the file open. Search for the file name, close the process, and then delete the file.

Check the Physical Write-Protect Switch

Many external hard drives, particularly 2.5-inch portable models, have a tiny switch on the side or bottom of the enclosure. It is often labeled with a lock icon. If this switch is in the locked position, the drive becomes read-only. You will see an error like "The disk is write-protected" when you try to delete or modify files.

To fix it, unplug the drive, move the switch to the unlocked position (usually the opposite direction), and reconnect. If the switch is broken or stuck, you can sometimes override it with a registry change, but that is a last resort and only works on Windows for internal drives, not USB ones. For USB drives, the switch is hardware-level, so it must be physically fixed.

Fix File Permissions (Windows and Mac)

If the file is not locked by a program and the switch is fine, the issue is likely permissions. On Windows, external drives formatted as NTFS have ACL (Access Control List) permissions. If you connected the drive to a different computer or user account, you may not have the right to modify the file.

To take ownership and delete:

  1. Right-click the file or folder, select Properties.
  2. Go to the Security tab, click Advanced.
  3. Next to "Owner," click Change.
  4. Type your username, click Check Names, then OK.
  5. Check "Replace owner on subcontainers and objects" and click OK.
  6. Go back to the Security tab, click Edit, and grant yourself Full control.

On macOS, external drives formatted as APFS or HFS+ have POSIX permissions. Right-click the file, select Get Info, and at the bottom of the window, expand the Sharing & Permissions section. Change the privilege for your user to Read & Write. If the lock icon is closed, click it and enter your password.

For drives formatted as exFAT or FAT32, permissions are not stored, so this step will not apply—the problem is more likely a file system error or a hardware issue.

Run a Disk Check to Repair File System Errors

If the file still will not delete, the drive's file system may have a minor corruption. This can happen after an improper ejection or a power surge. Windows has a built-in tool called CHKDSK that scans and repairs these errors.

To run it:

  1. Open Command Prompt as administrator (search "cmd," right-click, Run as administrator).
  2. Type chkdsk E: /f (replace E: with your drive letter).
  3. Press Enter. If the drive is in use, you will be prompted to schedule it on restart—do that.
  4. Let the scan complete. It may take several minutes for a large drive.

On macOS, use Disk Utility > select the drive > First Aid > Run. This will check and repair the volume. Note that CHKDSK and First Aid can fix logical errors but not physical damage. If the drive has bad sectors, the file may be on a damaged part of the disk, and no software will recover it.

When All Else Fails: Use a Live Linux Boot or Command Line

If you have tried everything and the file is still there, you can try deleting it from a different operating system. A live Linux USB (like Ubuntu) can often delete files that Windows or macOS cannot because Linux ignores Windows ACLs and does not hold file handles the same way. This is a safe, non-destructive method if you are careful to select the correct drive.

Alternatively, on Windows, you can try the command line with the del command in an elevated Command Prompt:

del \\?\E:\path\to\file

The \\?\ prefix bypasses some path length and permission checks. On macOS, use rm -f /Volumes/DriveName/path/to/file in Terminal. These commands do not move the file to the Recycle Bin—they delete it permanently, so double-check the path before running.

Frequently Asked Questions

Why does my external hard drive say "The disk is write-protected"?

This message almost always means the physical write-protect switch on the drive enclosure is in the locked position. Check the sides and bottom of the drive for a small sliding switch. If there is no switch, the drive may be failing or the controller has set a read-only mode to protect data—back up your data and consider replacing the drive.

Can I delete a file that is stuck in the Recycle Bin?

Yes, but it is tricky. If the file is on an external drive, the Recycle Bin stores it in a hidden folder called $Recycle.Bin on that drive. To empty it, right-click the Recycle Bin and select "Empty Recycle Bin." If that fails, run rd /s E:\$Recycle.bin in an elevated Command Prompt (replace E: with your drive letter). This permanently deletes all files in the bin on that drive.

What if the file is too long or has invalid characters?

Windows has a maximum path length of 260 characters by default. If your file path exceeds that, you will get an error. Use the \\?\ prefix in Command Prompt as shown above, or rename the parent folder to a shorter name. Invalid characters like a trailing dot or space can also cause issues; use the command line to delete those.

Will reformatting the drive fix the problem?

Yes, reformatting will delete everything on the drive, including the stuck file. But it is a last resort because it erases all data. Before reformatting, try the other fixes. If you reformat, choose NTFS for Windows-only use, exFAT for cross-platform compatibility, or FAT32 for very old devices (but note FAT32 has a 4GB file size limit).

Is it safe to delete files using a Linux live USB?

Yes, as long as you are careful to select the correct drive and partition. When you boot from a live USB, the external drive will appear as a mount point. Use the file manager or terminal to delete the file. This method is safe because Linux does not enforce Windows ACLs, and it does not hold file handles open. Just make sure you do not accidentally delete the wrong drive.