How to force delete files in Windows 10
If Windows prevents you from deleting a file, you can use a single command to force delete the file from the command line. Here's how you do it.
How are files in Windows deleted?
You can usually delete almost any file or folder by pressing a button Delete
on the keyboard. Once deleted, the file will be moved to the Recycle Bin so you can restore deleted data as needed. To bypass the Recycle Bin and permanently delete a file, you can use the keyboard shortcut Shift
+ Delete
.
When a file is being used, it cannot be deleted in normal ways. If you try to do that, you may receive the "Access Denied: File in use" error message . This is mainly because the file is locked by an application. There is usually no simple way to know which application is blocking a file and prevent you from deleting it.
In those situations, you can execute a command to force the deletion of files.
Important note : Before forcing deletion, make sure that no important data is stored in the file and that it is safe to delete the file. Also, make a backup before deleting the file. Once deleted, you cannot recover files.
Force delete file
To force delete a file in Windows, we will use a single command line. As soon as you execute the command, the target file will be deleted.
1. The first thing you need is the file path. Open File Explorer and go to where the file is stored. Next, click on the address bar and copy the path.

2. Now, open the Command Prompt with admin rights.
3. In the Command Prompt window , execute the command below, replacing X with the actual drive letter. For example, the article file is stored in drive E :. So E is entered in the command below.
If the file you are trying to delete is in C drive, you can skip this step.
X:

4. When you are in the destination drive, execute the command below, replacing it with the actual path you copied earlier.
cd "E:DummyFolder"

5. This step will take you to the file directory. Now, execute the following command, replacing fileName.ext with the actual file name along with the extension.
In the example case, the file to be deleted is a zip file. So the file name along with the .zip extension is entered.
del /s /q "fileName.ext"

6. If Windows can delete the file, you will see a Deleted File response .
You should read it
- How to add trash to permanently delete files on Windows 10/11
- How to batch delete files on Windows 10
- 2 ways to permanently delete files on Windows
- How to view recently deleted files on Windows 10?
- Steps to Delete junk files on Windows 10 thoroughly and effectively
- What is Temporary File? How to delete temporary files on windows computers
- 3 ways to delete recent files and folders in Windows
- How to schedule automatic file deletion in the folder Download Windows 10
May be interested
- How to permanently display Windows 10 version on desktopwith a simple tweak to the windows 10 registry file, users and system administrators can see exactly which operating system version is installed on a particular pc just by looking at the desktop.
- How to fix the problem where TaskSchedulerHelper.dll was not found in Windows 10sometimes during windows 10 startup, you may encounter an error missing task scheduler. follow the steps below to troubleshoot taskschedulerhelper.dll not found in windows 10.
- Fix F8 key not working in Windows 10if you upgrade to windows 10 from earlier versions such as windows xp, vista and windows 7, you may have noticed that the f8 function key you pressed while booting to enter safe mode no longer works.
- How to remove the Windows boot screen on Windows 10windows 10 boot time can be reduced by turning off or disabling splash screen in windows 10, using the system configuration dialog box. after disabling splash screen, windows 10 will boot faster.
- Fix Control Panel not opening in Windows 10windows 10 is definitely a great improvement when it comes to the windows computer operating system series. but there is an error related to the control panel. here are some solutions to fix the control panel error not opening on windows 10.
- How to exclude files and folders with Robocopy in Windows 10on windows 10, robocopy is a powerful command-line file management tool. in this guide, you'll learn the steps to copy data with robocopy on windows 10, except for unnecessary files and folders.