Physical storage space has consistently reduced with the rise in cloud technology. This had led to people deleting the files and folders that they do not require on their computer. However, with the complexity in operation of Windows 10, there are times when you may not be able to delete certain files and folders, instead getting an error message.
Here, I shall discuss four methods that you can use to delete a file that cannot be deleted normally in Windows 10.
How Do I Delete A File That Cannot Be Deleted In Windows 10?
As mentioned above, Windows may use certain files in multiple processes. This is one of the reasons why you cannot access or delete certain system files in Windows 10. One of the error messages you will get in this scenario is “The Action cannot be completed because the file is open in another program.” Check out the fixes for this error here.
Apart from this, there are other reasons as well, which include virus infection and disk errors. Here are the solutions you can try to force delete folder in Windows 10.
Solution 1: Check For Virus Or Malware
One of the first things you should check is if your computer is infected with viruses or malware. Hidden malware or viruses are one of the most prominent causes of inaccessible files or folders in Windows 10. Your personal data may also be at risk if your computer is infected with viruses.
There are many premium antivirus applications, which come with real time security tracking and firewalls. If you do not have a premium service, you can also choose from a plethora of free services, like Avast antivirus and Malwarebytes antimalware.
Solution 2: Check Task Manager
After you have verified that your computer does not have any viruses, you need to check if the application associated to the file or folder is running in the task manager. To quickly launch task manager, press Ctrl + Shift + Esc. Under the Processes tab, check for the application, file, or folder.
End the task using the associated button, and try deleting the file again. You should be able to delete the file now.
Solution 3: Force Delete Using Command Prompt
The command line interpreter in Windows 10 is a powerful tool if you know how to make the most out of it. Command prompt can even be used to edit registry files, and you can use the admin command prompt to delete the files that you cannot delete.
To use command prompt to force delete a folder in Windows 10, follow these steps:
- Open an admin command prompt. To do so, type cmd in Windows Search or a Run dialog. Press Ctrl + Shift + Enter to launch command prompt with administrative privileges. Click on Yes if you get the User Account Control prompt.
(Read here: How to add app to UAC exceptions)
- Next, type the following command to delete the file or folder from your computer:
del /f /q /a <complete path to the file with extension>
The del command is used to delete files and folders in Windows 10 and can be customized with many attributes. These attributes are as follows:
/P Show confirmation prompts before deleting.
/F Force deleting of read-only files
/S Delete specified files from all subdirectories
/Q Quiet mode, does not show confirmation prompt even on global wildcard
/A Selects files to delete based on attributes
Solution 4: Boot Into Safe Mode And Unlock File
If you do not want to be involved with command line interpreters, you can instead use safe mode to unlock the files and boot from there. Safe mode is the operating system mode where all third party apps and files are disabled by default, so you can expect no interference from such applications.
To boot into safe mode and delete the file, follow these steps:
- Open the Start menu by clicking on the button or pressing the Windows key.
- Press and hold the Shift key on your keyboard and click on the power options.
- Click on Restart.
Your computer should boot into Advanced Recovery settings.
- Click on Troubleshoot > Advanced Options > Startup Settings, and click on the Restart button.
- In the Startup Settings, press F4, F5, or F6 to boot into Safe mode, with networking, or with command prompt. We recommend pressing F6 to launch with command shell, so that you can use Solution 3 above as a backup solution.
- Once you have entered safe mode, simply delete the folder using file explorer.
Now, a simple restart will boot you back into the main Windows environment, where you should not see the deleted file anymore.
So, there you have it. Now you know how to delete a file that cannot be deleted, using the solutions provided above. If the solutions mentioned above did not help you, then wiping the partition may be only option left for you. Comment below if you found this useful, and to discuss further the same.