Force delete a file or folder in Windows

It can be frustrating to delete a stubborn file or folder from your Windows PC. For example, you can press delete and think the file or folder is gone, only to find it in the exact location you deleted it from.

There are several reasons why you cannot delete a file or folder, including:

This guide will show you how to force delete a file or folder in Windows 10 and get rid of it for good.

Force delete a file or folder in Windows

You can force delete a file or folder in Windows using Command Prompt, Safe Mode, a keyboard shortcut, or a third-party app. Before you try any of these methods, here are a few basic steps to help you solve the problem:

  • Close any running applications or programs on your computer and delete the file or folder again.
  • Using Task Manager to close the file or folder, and then try to delete it again.
  • Restart Windows and see if you can successfully delete the file or folder once your computer has restarted.
  • run a virus or malware scan to check for threats lurking on your PC.
  • Make sure 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 did not solve the problem, then use the methods below to force delete a file or folder in Windows.

Force a file or folder in Windows using Command Prompt

Command Prompt on Windows PCs can perform advanced management functions, automate tasks via batch files and scripts, and troubleshoot Windows.

Force Deletion of a File Using Command Prompt

  1. Type cmd in the search box and select Run as administrator
  1. Type cdx:\ and press Enter† In this case, x is the name of the drive letter, which is the folder containing the file you want to force delete.
  1. Type share filename and press Enter† Make sure to replace the file name with the name of the file you want to delete in Windows.

You can also type the command as del /F c:\users\thispc\desktop\filename to force delete the file if it is read-only. In this case, enter del plus your de /F parameterthe the location of the file, and the file namewhich would look something like this: del /F c:\admin\thispc\desktop\deletethis

Remark: If you use del to delete a file in Windows, you won’t be able to retrieve the file later.

Forcibly Delete a Folder Using Command Prompt

If the folder contains a file, 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 a lot of nested files and folders, but here’s how you can do it quickly.

  1. Open Command PromptRun as administrator
  2. Use the /s flag with rmdir to delete the directory along with its subdirectories and files. For example, if you want to delete a folder named “Test Folder”, enter rmdir /s test folder
  1. When prompted to confirm the deletion, select Yes and press Enter

Remark: any folder you delete with the rmdir command could not be retrieved.

Delete a file or folder in Windows using safe mode

Safe Mode is a diagnostic 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 that you would not otherwise be able to delete.

Go to safe mode, locate the file or folder you want to delete and restart 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 deletion of a file or folder after trying the steps above, you can use a third-party program to make it easier to delete the files and folders.

Unlock is one of the best file or folder removal programs that can help you regain control of your data by unlocking files and ending unresponsive processes.

The app can kill processes, remove 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 have to be careful when using the app.

Other similar tools you can use include: File Assassin and Long Path Tools

Remove stubborn files and folders from your PC

Deleting non-deletable files and folders from your computer can be stressful. However, the solutions here should work 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.

Leave a Reply

Your email address will not be published.