Trying to delete a stubborn file or folder from your Windows PC can be frustrating. For example, you could be pressing delete and thinking the file or folder is gone, only to find it in the exact location you removed it from.
There are several reasons why you can’t delete a file or folder, including:
- The file may be in use by another program, background process, or application.
- The file’s unlock process may not have been completed.
- Disk failure or corruption.
- The folder or file is read-only or corrupted.
- You may be trying to delete a system file.
- The Recycle Bin is either full or corrupted.
- The file or folder is infected with malware or a virus.
- The disk is write-protected or full.
- You get the Access Denied warning when you try deleting files or folders from a mounted external drive.
This guide explains how to force delete a file or folder in Windows 10 and get rid of it for good.
How to Force Delete a File or Folder in Windows
You can force delete a file or folder in Windows via Command Prompt, Safe Mode, using a keyboard shortcut, or using a third-party app. Before trying any of these methods, here are a few basic steps to help you get around the issue:
- Close any running applications or programs on your computer, and then delete the file or folder again.
- Use Task Manager to close the file or folder and then try deleting it again.
- Restart Windows and see if you can delete the file or folder successfully once your computer reboots.
- Run a virus or malware scan to check for threats that may lurk within your PC.
- Check whether the file or drive is marked as read-only, otherwise you may not be able to delete the file or folder. You can do this by right-clicking on the file or folder and selecting Properties.
- Update Windows and then try to delete the problematic file or folder.
If the above basic steps didn’t help resolve the issue, use the methods below to force delete a file or folder in Windows.
Force Delete a File or Folder in Windows Using Command Prompt
Command Prompt in Windows PCs can perform advanced administrative functions, automate tasks via batch files and scripts, and troubleshoot issues in Windows.
How to Force Delete a File Through Command Prompt
- Type CMD in the search box and select Run as administrator.
- Type cd x:/ and press Enter. In this case, x represents the name of the drive letter, where the folder containing the file you want to force delete resides.
- Type del filename and press Enter. Make sure you replace the filename with the name of the file you want to delete in Windows.
Alternatively, type the command as del /F c:/users/thispc/desktop/filename to force delete the file if it is read-only. In this case, you’ll enter del plus your the /F parameter, the file’s location, and the filename, which would look something like this: del /F c:/admin/thispc/desktop/deletethis.
Note: If you use del to delete a file in Windows, you can’t retrieve the file later.
How to Force Delete a Folder Through Command Prompt
If the folder has a file in it, you can use the steps above to force delete the file and then use Command Prompt to delete the folder. This process can be tedious and time-consuming if you have many nested files and folders, but here’s how to do it quickly.
- Open Command Prompt > Run as administrator.
- Use the /s flag with rmdir to force delete the folder along with subfolders and files in it. For example, if you want to remove a folder called “Test Folder”, enter rmdir /s test folder.
- If you get a prompt to confirm the deletion, select Y and press Enter.
Note: Any folder you delete using the rmdir command cannot be retrieved.
Delete a File or Folder in Windows Using Safe Mode
Safe Mode is a diagnostics mode that starts Windows in a basic state with a limited set of drivers and files. You can delete files or folders in Safe Mode, which you’d otherwise not be able to delete before.
Enter Safe Mode, find the file or folder you want to delete, and then reboot your PC to exit Safe Mode.
Use a Third-Party Program to Force Delete a File or Folder in Windows
If you still cannot force delete a file or folder after trying the steps above, you can use a third-party program to simplify the deletion of the files and folders.
Unlocker is one of the best file or folder deletion programs that allows you to regain control over your data by unlocking files and killing unresponsive processes.
The app can kill processes, unload DLLs, unlock, delete, rename or move locked files without restarting your computer and deleting index.dat files. However, Unlocker can kill important processes and delete critical files from Windows, so you need to be cautious when using the app.
Other similar tools that you can use include File Assassin and Long Path Tool.
Remove Stubborn Files and Folders from Your PC
Trying to remove undeletable files and folders from your computer can be stressful. However, with the solutions here, you should get around this problem and delete the files or folders for good.
Let us know what worked for you by leaving a comment in the section below.