Deleting a file or folder in Windows 10 is generally quite easy. You just have to right-click on the item you want to delete, and from the context menu, select the Delete option. You can also delete a file/folder permanently by selecting it and pressing the Shift+delete keys.
However, some files or folders are stubborn. Whatever you do, how many times you do, they won’t get deleted. Generally, they show ‘Folder/File In Use’ error.
It means that some other application is using that file. Similarly, if you are unable to delete a folder, then it means the folder contains a file which is in use. When a file is in use, you can not delete it until the program which is using that file is closed. Sometimes it can be challenging to find the program that is preventing the file from being deleted.
Well, you need not worry anymore. We are presenting two simple methods by which you can easily force delete the files and folders used by an application.
Force Delete Files and Folder Using Command Prompt
On Windows, where would you go to perform the otherwise hard to execute tasks? The answer is quite simple – Command Prompt.
For Windows users, when the going gets tough, the Command Prompt gets going. Using Command Prompt, you can delete any folder or file; it does not matter whether an application is using it. The most essential thing to keep note of is you can delete the file/folder using a single command line.
In this example, you can delete a file/folder using cmd. Here are the steps to do it.
- Copy the Path
Copy the path of the folder which you want to delete
- Run Command Prompt as Admin
Type Command Prompt on Windows search box. Right-click on its icon and select Run as Administrator.
- Reach to the Desired Drive
On command prompt first, reach to the drive where the folder which you want to delete is present. Type “F:“, in place of ‘F’, put your drive letter.
- Reach To the Desired Path
Now execute this command to reach the path where that folder is present:
- Execute the Command
Execute the following command to delete the folder:
del /s /q “Undeletable”.
In this case, we are deleting the folder named Undeletable. You can put the file name, which you are deleting in place of Undeletable, along with its extension. For example, if you are deleting a zip file, do not forget to write .zip after the filename.
- Folder Deleted
After executing the command, if the folder gets deleted, the following message would be shown:
Note that the file Undeletable.exe was inside the folder Undeletable, so it also gets deleted.
This method deletes the file completely and data cannot be found in recycle bin. If you want to recover such accidentally deleted file, use tools like MiniTool Data Recovery.
Force Delete a File/Folder in Windows 10 Using Safe Mode
In Safe Mode, most of the applications are stopped, so there is an excellent chance to delete a file/folder that could not be deleted because an application is using it.
1. On your Windows 10 system, enter the safe mode. Go to Start -> Settings -> Update & Security -> Recovery -> Restart now(under Advanced Startup) to enter the Windows recovery environment.
2. After the PC restarts, you would be on Choose an option screen. Select Troubleshoot > Advanced options > Startup Settings > Restart
3. In the Startup Settings, press F6 to enter Safe Mode with Command Prompt.
4. After entering the Safe Mode, perform the normal delete action. You should be able to delete the file or folder quickly.
Change the Ownership of File or Folder
Sometimes the File or Folder refuses to get deleted because you are not the owner of it. In that case, you have to first transfer the ownership of the file to yourself and then try to delete it. Here are the steps for that:
- Right-click on the file that is refusing to delete and choose Properties.
- Under the Security tab, select Advanced settings.
- On the right side of the owner, click on Change.
- Type your username to transfer the file’s ownership to yourself. Click on Check Names to ensure that the user exists. Lastly, click OK. Close the window.
- Again, right-click on the file and select Properties.
- Under the Security tab, click on Edit to change the permissions of the file.
- Checkmark the Allow option next to the Full Control. Click Apply and OK.
- Try deleting the files now.
Find out which Process is Using the Folder or File
Sometimes files or folders refuse to delete as a process is using them. You can find out which process is using the folder and end it. Here are the steps for that:
- On the windows search bar, type Resource Monitor and click on its icon to launch.
- Under the CPU tab, use the search field in the Associated Handles section for finding the process.
- Here Test folder is searched to find out which process is using it.
- Right-click on the process and choose End Process.
- Try deleting the folder or file now
Final Words and FAQs
We find these two working methods to force delete a folder or file in Windows 10. Before performing the deletion, make sure that the folder or file you are going to delete is not essential. Remember, once deleted, you won’t be able to recover the file.
To delete the undeletable folder, follow any of the two methods mentioned in this guide. These methods are self-tested on Windows 10 version 1909.
The procedure to delete a stubborn file is the same as deleting a folder. In place of the folder name, type the file name with its extension to delete it.
The reason you are not able to delete a file on Windows 10 is that an active application of Windows may use that file.
Peter is an Electrical Engineer whose primary interest is tinkering with his computer. He is passionate about Windows 10 Platform and enjoys writing tips and tutorials about it.