Most of Windows users will get the message that "The action can`t be completed because the file is open in another program. Close the file and try again" when you try to delete the useless files on Windows or PC. This means they are the undeletable files on your Windows system. However, these kind of locked files take lots of Windows space, you can close the dialogue immediately and keep the files on your Windows unless you need a large space to store your own important files, you can force windows to delete these kind of files in 4 ways by referring to this article.

Method1. Close Windows explorer to force delete a file  

 

If you need to delete a file while you are surfing on the Internet and it failed, it is probably that your Internet Explorer are using this file so it prevents your delete proceed. In this case, you can use Task Manager to find out and delete the target file.

There are 3 ways for you to open Task Manager in Windows:

Step1. Open Task Manager just by clicking CTRL + SHIFT + ESC. Alternatively, right-click Taskbar and select Start Task Manager or click CTRL + ALT + DEL anywhere in screen then choose Start Task Manager.

Step2. When the Task Manager shows up, turn to the Processes tab, then look through for the application that was used to open your target file.

Step3. Then right-click the target file and choose End Process Tree or End Task to close all instances of the program.

Method2. Boot Windows into safe mode to force to delete a file

 

Boot Windows into safe mode is feasible for Windows users to force to delete the locked files without installing any software, it is also suitable for the Windows that are involved with malware. Let`s take Windows 7 as an example to delete a locked file by booting windows 7 into safe mode.

Step1. Pressing F8 when Windows 7 is powering on or restarting when you hear the sound.

Step2. Press F8 until you see the picture below, choose Safe mode by using arrow keys.


Step3. Then delete the file in Windows Explorer or File Explorer.

For Windows 8, you can refer how to enter safe mode windows 7 to get Windows 8 into safe mode.

Method3. Use Command Prompt to force windows to delete a file

 

Step1. Ensure the location or the path of the target file, and write it down or remember it. The path will be look like C:\Windows\system32\

Step2. Go to Start-> Type Command Prompt in the search bar-> Click it.


Step3. The format "DEL /F /Q /A <File Path>" is needed to type into the command line. For example, you need to delete the file named "immigration" and it is saved in DEL /F /Q /A C:\Users\Lovejeet\Desktop\immigration.txt.


Step4. If you need to delete a folder, you need to type the RD /S /Q <Path of the Folder> into the command line.