It is not always possible to delete a file. For example because the file is in use or because you have insufficient rights. Get rid of that nonsense. Read here how to always get annoying files in Windows 10 deleted.
There are several reasons why a file cannot be deleted. The most common cause is that the file is in use by a program. For example, you are trying to move a Word document from the desktop to the trash, while it is still open in the word processor. Then the option is simple: close the open file and try again.
It becomes more annoying if you do not know in which program the document is opened or when Windows gives another message for not being able to delete a file. Fortunately, there are several solutions. These don't just apply to annoying files, of course, but also to entire folders.
Task Manager is a valuable part when trying to delete a file. It lists all programs that have been loaded. You open task manager with Ctrl+Shift+Esc. on the tab Processes look in the section Applications. Here you will find an overview of all open programs. If you don't see an extensive overview, click on More details.
Does Windows report that a particular file cannot be closed because it is open in a program? Then find the relevant program and right-click on it. Choose To end. All windows of the program are now closed. Try to delete the file again.
Sometimes it's not a program, but a process that holds the file hostage. You will notice this if you have closed the program and the file is still in use. Use task manager to close the process. On the Processes tab, look for yourself in the section Background Processes to the process associated with the program. For example: you cannot close a Word document. First, close Word. If the program is still in use afterwards, you can also close the associated Word processes (Winword.exe) via Background processes.
Windows Explorer offers the option to open each window as a separate process. In the past, this option was often checked to make Windows more stable. For example, if one open window crashes, the other windows will remain unaffected if you let them open in a separate process. If the windows are open in the same process, they will all be closed.
The setting with a separate process for each window can cause problems when deleting a file. Therefore, disable the option. Open Windows Explorer (Windows key + E) and choose the tab Image. Choose Options and click on the tab Display. Uncheck Open folder windows in a separate process. click on OK. Try to delete the file afterwards.
The preview can also throw a spanner in the works when you try to delete a file. The preview is active in Windows Explorer and shows a preview of a selected file, so you don't have to open it to view.
In the explorer, open the tab Image and click the button Preview window. Verify that the preview on the right of the window has disappeared. The key combination Alt+P also makes the preview disappear.
Some files intended for the operating system cannot be deleted. Then a disk cleanup offers a solution. Open the Start menu and type Disk Cleanup. click on Disk Cleanup. In the main window, click Clean up system files. The scan will be performed again – but this time more extensively. In the results window, put check marks next to Temporary files. click on OK.
For the slightly more advanced user, the command line is a handy alternative to delete annoying files. It is necessary to use the full path to the file in question. You can do that with the explorer. In the explorer, browse to the file you would like to delete. The full path is shown in the address bar. Double click on it to select the path, right click on it and choose To copy.
Open the command line from the Start menu. Type Command Prompt and right click on the search result Command Prompt. Choose Run as administrator. At the command line, type the following: CD . To use, right click on the position where you want the path to go. It is inserted immediately. Confirm by pressing Enter.
Now close the explorer process to increase the chances of success. Open the aforementioned task manager and right click on Windows Explorer. Choose To end. In the command line window, type: del . For example: Del “administration.docx”. Press Enter. There is a good chance that the file will now be deleted. Then restart the closed file process. In task manager choose File, Run New Task. type Explorer.exe and click OK.
By starting Windows in safe mode, you increase the chance that you can still delete the file. The safe mode starts Windows in the cleanest possible environment and thus prevents programs from being loaded automatically (and then taking your file or folder hostage).
Open the settings window: click on start and click on the gear on the left, or use the key combination Windows key + I. Go to Update & Security, System Restore. Bee Advanced Boot Options click the button Restart now. At startup, choose to let Windows start in safe mode. Immediately after startup, delete the file.
Try Process Explorer or LockHunter
Still not able to delete the file? There are many external helpers that help solve the problem. With Process Explorer – from Microsoft itself – you determine which program or which process has opened a file or folder. Download the latest version of Process Explorer here. You can use the program for free.
Extract all compressed files before you start with Process Explorer. After installation, open it by double clicking Procexp64.exe. In the main window you will find all processes that are currently running. To find out which program or process is using a file, use Process Explorer's built-in search function.
Choose File, Find Handle or DLL. You can also click on the binoculars icon. In the box Handle or DLL substring type the file name. Then click on Search. The search can take a while: Windows loads a lot of processes in the background. In the results window, look at Process which programs or processes are holding your file or folder hostage. Then open task manager and terminate these programs.
LockHunter also helps determine which program is using a file and integrates closely into the Windows user environment. Right click on the file and choose What's locking this file. A list of programs and processes that are claiming the file appears. Then you have several options, such as unlocking the file and deleting the file.
click on Other for additional features. Of Delete At Next System Restart delete the problem file after Windows restarts. Of Unlock & Rename you can immediately rename the file. Of Unlock & Copy you can copy the file. click on more details to check for additional information about the process. You can use LockHunter for free. During the installation, make sure that the program does not install other programs without being asked.
Caution is advised when using LockHunter. Before you delete a file, make sure that it is not an indispensable (system) file. Accidentally deleting a wrong file can lead to a damaged system.
After all, problems with the ownership (or better known 'ownership') of files also occur regularly in Windows. For example, you can't move or copy a file or folder because Windows thinks you don't have the right permissions to do so. This happens, for example, when you are working with a file created by another user, but after this user has been removed from the system. By 'appropriating' the file yourself, you solve the problem.
Open the explorer and browse to the folder or file you want to claim ownership of. Right click on the item and choose Characteristics. on the tab Security click on Advanced. The Advanced Security Settings window appears. Click now Modify. You will find this option on the line Owner, at the top of the window. click on Advanced and choose the user account you want to access the file or folder with. click on OK and close these windows.
Now right click on the file or folder again and choose propertiesn. Choose the tab Security and click Advanced. click on Add. Click on Eand select principal and select the account you want to access the file with. click on OK and add Basic permissions a checkmark Full management. click on OK. To make this setting also apply to all subfolders, put a check next to Replace all permission entries on child objects with inheritable permission entries from this object. Confirm with OK.
Dive deeper into Windows 10 and take control of the operating system with our Tech Academy. Check the Windows 10 Management online course or go for the Windows 10 Management bundle including technique and practice book.