A corrupted file won't open, move, or delete normally — but you can still remove it

A corrupted file is one whose data has been damaged or scrambled, usually because of a crash, power loss, or incomplete read. Windows and Mac will often refuse to delete it through the normal method because the operating system can't read what's inside. The file sits there taking up space, and you can't do anything with it.

You can delete a corrupted file, but the method depends on whether your computer recognizes it at all. If the file appears in your folder but won't open, you have several options. If your computer won't even show the file or keeps crashing when you try to access the folder, you may need to use the command line or boot into safe mode.

Key Takeaways

  • Most corrupted files can be deleted by right-clicking and selecting Delete, then emptying the Recycle Bin or Trash — the file doesn't have to be readable to be removable.
  • If Delete is grayed out or the file won't move to Trash, restart your computer in Safe Mode (Windows) or Recovery Mode (Mac) and try again.
  • On Windows, use Command Prompt with the del command if the graphical method fails; on Mac, use Terminal with the rm command.
  • If the entire folder is corrupted and won't open, you may need to delete the folder itself rather than individual files inside it.
  • Back up any files in the same folder before attempting deletion, because command-line deletion is permanent and does not go to Recycle Bin or Trash.

Try the simplest method first: right-click and delete

Start by right-clicking the corrupted file and selecting Delete (Windows) or Move to Trash (Mac). This works more often than you might expect — the file doesn't have to be readable for your operating system to remove it. You're not asking the computer to open the file or understand what's in it; you're just asking it to erase the data.

After you delete the file, empty your Recycle Bin (Windows) or Trash (Mac) to remove it permanently. On Windows, right-click the Recycle Bin icon on your desktop and select Empty Recycle Bin. On Mac, click the Trash icon in your dock, then select Empty Trash from the menu bar. If the file disappears from your folder and the Recycle Bin or Trash empties without error, the problem is solved.

Restart in Safe Mode if Delete is grayed out

If the Delete option is grayed out or you get an error message saying the file is in use, your operating system thinks something is still accessing the file. This often happens if a program crashed while using the file, or if Windows or Mac locked it during a failed operation. Restarting in Safe Mode closes background programs and gives you a cleaner environment to delete the file.

On Windows: Hold Shift and click the power button in the Start menu, then select Restart. When the blue screen appears, go to Troubleshoot > Advanced Options > Startup Settings, then click Restart. When the menu appears, press 4 or F4 to boot into Safe Mode. Once you're in Safe Mode, try right-clicking the file and deleting it again.

On Mac: Restart your computer and when ready hold Command + R until you see the Apple logo. This boots into Recovery Mode. Open Disk Utility from the Utilities menu, select your hard drive, and click First Aid to check for errors. Then restart normally and try deleting the file. If that doesn't work, open Terminal (also in Utilities) and use the command rm /path/to/file, replacing the path with the actual location of your file.

Use Command Prompt on Windows for stubborn files

If Safe Mode didn't work, you can delete the file using Command Prompt, which bypasses the graphical interface. Open Command Prompt by pressing Windows key + R, typing cmd, and pressing Enter. Navigate to the folder containing the corrupted file by typing cd C:\Users\YourUsername\FolderName, replacing the path with your actual folder location.

Once you're in the correct folder, type del filename.ext, replacing filename.ext with the actual name of the corrupted file. Press Enter. Command Prompt will delete the file when ready without sending it to Recycle Bin — it's gone permanently. If you get a "file not found" error, double-check the filename and folder path. If you get a "file is in use" error, restart in Safe Mode first and try again.

Use Terminal on Mac for command-line deletion

On Mac, Terminal gives you the same low-level access to delete files that won't respond to normal methods. Open Terminal by pressing Command + Space, typing Terminal, and pressing Enter. Navigate to the folder containing the file by typing cd /path/to/folder, replacing the path with your actual folder location. You can find the path by opening Finder, right-clicking the folder, and selecting Copy as Pathname.

Once you're in the correct folder, type rm filename, replacing filename with the actual name of the corrupted file. Press Enter. The file will be deleted when ready and permanently. If you get a "permission denied" error, try sudo rm filename instead, then enter your Mac password when prompted. Be careful with Terminal — there is no undo, and deleted files do not go to Trash.

Delete the entire folder if individual files won't budge

Sometimes a corrupted file is part of a larger corrupted folder, and the folder itself won't open or respond to deletion. In this case, you may need to delete the entire folder rather than individual files. Before you do this, make sure you have backed up any files in that folder that you want to keep — you cannot recover them once the folder is deleted.

Try right-clicking the folder and selecting Delete. If that doesn't work, restart in Safe Mode and try again. If the folder still won't delete, use Command Prompt on Windows with rmdir /s C:\path\to\folder or Terminal on Mac with rm -r /path/to/folder. The /s or -r flag tells the system to delete the folder and everything inside it.

Prevent corruption by shutting down safely and backing up regularly

Corrupted files usually happen because of a sudden power loss, a crash during a save, or a failed read. You can't prevent every crash, but you can reduce the risk. Always shut down your computer properly instead of forcing it off. On Windows, click the power button in the Start menu and select Shut Down. On Mac, click the Apple menu and select Shut Down. Don't unplug your computer or force the power button unless it's completely frozen.

Back up your important files regularly to an external drive or cloud storage. If a file becomes corrupted, you'll have a clean copy to use instead of trying to salvage the damaged version. Most corrupted files are not worth the effort to recover — it's faster and safer to delete them and restore from backup.

Frequently Asked Questions

Can I recover data from a corrupted file before I delete it?

If the file won't open, the data is likely unrecoverable without specialized software, and even then recovery is not may provide. If you have a backup of the file, use that instead. If you don't have a backup and the file is critical, you can try file recovery software like EaseUS Data Recovery or Recuva, but success depends on how badly the file is damaged.

Why does my computer keep crashing when I try to open the folder with the corrupted file?

Your operating system is trying to read the corrupted file and failing, which can cause the folder to freeze or crash. Don't keep trying to open the folder — this can make the corruption worse. Instead, delete the file using Safe Mode or Command Prompt without opening the folder first.

What if I delete a file by mistake using Command Prompt?

Files deleted through Command Prompt or Terminal do not go to Recycle Bin or Trash — they are permanently erased. You cannot undo the deletion through normal means. If the file is important, you may be able to recover it with data recovery software, but there is no may provide. Always back up files before using command-line deletion.

Is it safe to delete a file I'm not sure about?

If you're not sure what a file is, don't delete it yet. Search the filename online or ask in a tech forum to find out what it does. If it's a system file (usually located in Windows, System32, or Library folders), leave it alone — deleting system files can break your operating system. If it's a file you created or downloaded, it's usually safe to delete.

Do I need to defragment my drive after deleting a corrupted file?

On Windows, defragmentation can help, but it's not necessary after deleting a single file. On Mac, defragmentation is not recommended — modern Macs handle file organization automatically. If you've deleted many files and want to reclaim space, restarting your computer is usually enough.