Is it possible to delete a file if it is open in Windows Explorer. How to delete an open file in Windows
To enable data cataloging in Windows, as well as in other operating systems, a tree structure is used, which is a set of nested special file container objects called folders. In Windows, folders can be system folders that contain files of the operating system, can be custom and software, that is, those that are created by third-party applications.
As a rule, the user can do whatever he wants with folders of the second type; he also has a lot of powers when working with program directories, for example, he can manually delete the folder remaining on the disk after uninstalling the application, but there are cases when the folder cannot be deleted in the usual way. There may be several reasons for this. Most often this happens due to the user's lack of necessary rights access, also the directory may be held by some process, may have an incorrect name, the path is too long, etc.
The folder is not deleted due to lack of administrator permission
Let's look at how to delete a folder if the action asks for permission from the administrator. This problem is most often encountered by users working under regular or guest account, but this is also possible when you yourself are the computer administrator.
In the first case, to delete a folder, you will have to enter the password of the PC owner account, since the system will constantly ask you for it, or use in a universal way, which will be discussed at the end of the article.
But what should you do if the folder is not deleted when working under an administrator account?
The reason may be that you either do not own it or do not have the appropriate access rights. Open the folder properties, switch to the “Security” tab and click the “Advanced” button in the window that opens.
In the new window, opposite the “Owner” line, click on the “Change” link.
In the next window, click the “Advanced” button. Another window will open.
Leave the object type in it as “User”, then click the “Search” button and select the user you want to make the directory owner from the list that appears at the bottom.
Click "OK" and "OK" again.
After the owner has been replaced, check the box next to “Replace owner of subcontainers and objects” and save the settings.
Next, you will need to provide the new owner with full rights access to the folder. Click “Edit” in the properties window, select the desired user in the permission changes window, grant him full access rights and save the settings.
After this, the folder should be easily deleted.
Note: Folders owned by the system service are deleted in the same way. First, the owner of the folder is changed, then he is granted (if necessary) full rights and the folder is deleted.
The folder is being used by another program
Like any other file system object, a directory may not be deleted because it is being used by some process. How to delete a folder in this case? The first thing you need to try to do is to identify the holding process, the second thing is to complete it in forced mode using Task Manager or another specialized utility. In most of these cases, when the folder is not deleted, Windows writes that it is being used by another program, and the name of this program is usually indicated in the message box.
But it may also be that the program name will not appear. In such a situation, the utility can be a great help Process Explorer, included with the Sysinternals administration tools. Run the utility (it's portable), select from the main menu Find – Find Handle or DLL.
Enter the name of the folder to be held in the “Handle or DLL substring” field and click “Search”. In a couple of seconds you will get the name of the process, its PID in the Task Manager and the full path to the object used by the process.
By the way, using the utility, you can end the process and then delete the folder itself.
The system says that it could not find this element
Among the “undeletable” folders there is a special group that belongs to the so-called ghost objects. The difficulty here lies in the fact that it is not always possible to identify the reason for the appearance of such an object. This could be an incorrect (long or reserved) name, the action of a malicious program, another process blocking it, or damage to the file system. We already know how to check whether a process is blocking, now let’s try to figure out what to do if the folder is not deleted from the desktop with the message “this item could not be found.”
If the folder has a system reserved name, such as COM or PRN, you can delete it using the command line. Run CMD console as administrator and run the following command:
rd //./Disk:/full path to the folder
To delete a "non-deletable" folder from too long name, first you need to know it short name-pseudonym. This is done again using the command line. Team cd /d (path) go to the parent directory of the problematic directory and print out the names of all the objects it contains using the command dir/x/n.
Note: if the folder is on drive C, the key /d does not need to be used in a jump command.
In our example, a folder with a name consisting of many dots has a short name 782F~1. Knowing the alias, we can safely delete it:
rd C:/Users/compik/Desktop/782F~1
A case that deserves special attention is when a folder is not deleted not because it has the wrong name or is being held by a system process, but because it simply does not exist, which may be indicated by the absence of an object in the command line list or the LiveCD file manager. This may indicate damage to the file system, therefore, before taking any further action, the disk must be checked for errors with the command CHKDSK.
Action of viruses
Less likely, but viruses that have entered the system can create a similar problem. Their action may be indicated by the constant automatic re-creation of a folder after it is deleted from using LiveCD or special utilities, as well as the presence of suspicious hidden files, executable or configuration. The solution to the problem in such cases is standard - full check at least two computers antivirus scanners, produced preferably in offline mode before loading the operating system.
Invalid attributes
Another possible reason why a folder is not deleted is that the system and read-only attributes are set for it. It is not difficult to check the presence of such “retaining” attributes; it is enough to command line execute attrib command[full path to folder]. The presence of the S or R keys will indicate that the folder is read-only or system. To unlock a directory, run the following command in a command prompt running as administrator:
attrib -r -s D:/Private /d /s
IN in this example we removed the “Read Only” and “Hidden” attributes for the Private directory at the root of drive D. After changing the attributes, the folder can be deleted.
If the folder is not deleted from the desktop or any other location, you can try using free utility Unlocker. This lightweight and extremely easy-to-use tool allows you to delete files and folders locked by system and third-party processes, and can also be useful when deleting objects that require higher access rights than local administrator, problems with sharing files and folders, as well as other errors.
How to delete a folder in Windows 7/10 using Unlocker? Very simple. During the installation process, the utility is built into the Explorer context menu, so to delete an object you just need to right-click on it and select the “Unlocker” option in the menu. If the object is not deleted immediately, a window will appear in which you can select the desired action, such as deleting, renaming and moving. If a file or folder is locked by a system process that cannot be closed immediately, the utility will offer to delete the object when the computer restarts.
Above, we figured out why a folder may not be deleted from the computer, and at the same time we looked at the main ways to solve the problem. In conclusion, we suggest considering another way to delete blocked folders. Its main advantage is its versatility, since it allows you to gain almost unlimited access to file system computer. For this you will need any LiveCD on Linux based or WinPE with built-in file manager. Having set the appropriate priorities in the BIOS, boot from such a disk, find the blocked object using the built-in Explorer and delete it.
There are situations when the user wants to close or delete a file, but cannot do this, since it is “opened in another program” and then he starts looking for information about how this open file delete.
It will be useful to consider all the ways in which such a problem could be solved and a given task accomplished. One of them will definitely suit you.
Via command line
To use this method, you must open the command prompt as an administrator.
This is done as follows:
- In the "Start" menu (Windows), open "All Programs" and in the "Accessories" section find the "Command Prompt" item.
- Right-click on this item and select “Run as administrator.”
Then on the command line you need to enter the following command:
net file [file name] /close
For example, if running file called "geek-nose.exe", then this command will look like this: net file geek-nose.exe /close
If you need to know the name running program, then it is written in the message about the open file itself.
Via task manager
Knowing the file name allows you to use another method to delete files open in other programs.
In fact, this method implies that the user will close the program in which the file is open.
To open the task manager, you need to press Ctrl + Alt + Delete or Win + X and select “Task Manager” from the list of options.
You can also right-click on the bottom panel and select “Launch Task Manager” from the drop-down menu.
In the “Applications” tab, you need to find the required file and click on the “End task” button. You can also right-click on it.
In the drop-down list, click “Go to process”.
After this we will be taken to the “Processes” tab, there we will click on again specified file right-click and select “End Process” from the drop-down menu.
After this, you need to try deleting the file again.
If it still does not delete, you can try clicking on the “End Process Tree” option.
It is possible that some program that is located one level higher or lower in the tree does not allow this to be done. Not working? Then we move on to the next method.
Using the Computer Management menu
This method involves performing the following actions:
- Launch the “Computer Management” menu. The easiest way to do this is by searching in the Start menu (Windows).
- In the menu on the left, first open “Service”, then “ Shared folders" and "Open files".
- In the menu that opens, right-click and select “Disable all open files.”
You may see a list of all open files. Then you can right-click on each of them and select disable.
But in our case, nothing was displayed in this list at all - despite the fact that quite a lot of processes were running on the computer and many files were open.
This means that the computer management menu does not always work correctly and display a valid list of open files.
Attention: Even if nothing appears in the Open Files folder of the Computer Management menu, you still need to right-click and select Disable....
Now you can try to delete the file again.
Unlocker
This little utility is very easy to use and allows you to delete files opened in another program in a matter of seconds. You can download it on the official website.
After installation, it will be integrated into the context menu (the one that opens by right-clicking on any file or folder).
To use Unlocker to delete open files, you must do the following:
- Click on the file that is not deleted and edit it with the mouse button. Select “Unlocker”.
- Among the actions, select “Delete”. You can also click the “Delete process” or “Unblock all” buttons.
There is another program that can also unlock various files and thereby give the user the opportunity to delete them. It's called DeadLock.
Using DeadLock
IN lately Along with Unlocker, a huge number of unwanted programs and even viruses are installed. This even applies to the installer from the official website.
In addition, antiviruses and firewalls are increasingly blocking Unlocker. Therefore, DeadLock looks like a very worthy alternative.
- Drag the desired file into the program window with the mouse cursor.
- Right-click on it and select “Unlock”, then “Unlock” again or “Delete” to immediately delete it.
Uninstall in Safe Mode
In order to run it this way, you need to press the F8 button when starting the computer and select something related to safe mode from the list of options.
In most cases, it is called “Safe Mode”.
You can try to combine this method with one of the above.
For example, when the system is loaded in safe mode, you can unlock the file through DeadLock or Unlocker, if they are installed on the computer.
Instructions
First, reboot - perhaps the folder was actually occupied by some process, and this will solve this problem.
Also check if you have installed this folder any that you are working with and which is running, and check if there is any data encryption in the properties. Also, the folder should not have the name system folder.
If all of the above steps do not lead to success, open the folder with the file that is not . Go to the folder properties in the “Tools” section and open the “View” tab. Check if there is a checkmark in the “Use simple general access to files." If it is there, remove it, click OK and close properties. After that, right-click on the file and bring up properties. In the “Security” tab, open “Advanced” and uncheck all the checkboxes for reading and execution. Try the locked file now.
It may also help you good guide Total Commander, displaying blocked files and folders. If you find an encrypted file, press Ctrl+Alt+Delete and look in the processes to see if there is anything there that matches the name of the locked file. If the process is found, stop it and delete the file.
If all these methods lead to nothing, use the last and most effective way to delete folders and files - download and install the Unlocker program. This program will allow you to delete even locked files and folders, as well as rename them, move them and perform other operations. After you install the program, right-click on the folder or that you want to delete. You will see in context menu the Unlocker icon appears - click it, unlock the file in the window that opens and delete it.
Video on the topic
Sources:
- deleting folders
PC users create and delete daily files using familiar and familiar commands. Sometimes it happens that a number of documents simply cannot be deleted. Those who are familiar with the computer only at the user level are perplexed by this turn of events. However, there is a way out; you can clean your computer even if there is no access to the files to be deleted. access.
Instructions
There are many reasons why you cannot delete a file from your . The whole point may be in the structure of the file, its purpose, features of the operating system, etc. Sometimes files may be busy with another program (most often or daemon tools). In this case, you just need to close the programs or restart the computer (the main thing is to this program was not in). If in the usual way fails, go to Task Manager and close unnecessary process.
Video on the topic
Please note
But you should also understand that if the file cannot be deleted, perhaps it is necessary (system). There will be no harm in deleting downloaded images or various types of garbage, but it is not recommended to touch system files.
Sources:
- how to delete a file that is not accessible
Tip 3: How to uninstall a program if it cannot be uninstalled through the Control Panel
Some applications are installed on a computer via a virus and remain hidden in the system, causing various inconveniences to users. You can remove a program if it cannot be removed through the control panel using system registry, and also with the help special applications.
Instructions
If the program is through the control panel, that is, it is simply not in the list installed applications, try to find the place where it is installed. To do this, search through the Start menu for the name of the program. If there is a program shortcut in the main menu or on the desktop, right-click on it and select Properties. Click "File Location" to navigate to the desired folder. You can also find out the location of the program by clicking Ctrl combination+ Alt + Del and selecting the name desired application in the list of current system processes.
When you locate the application folder, locate the uninstall service file in it, usually called Uninstall, and run it to begin uninstalling. If there is no file with a suitable name, you can delete the entire application folder at once. Usually this is enough to stop its activity. However, some virus programs leave behind traces in the system, causing harm to it.
Go to the system registry, which contains information about all installed programs. Press the combination Win + K and enter the word Regedit. Go to the HKEYCURRENTUSER tab, then Software and find the name of the application you need in the list, then delete this tab from the registry. Do the same on the HKEYLOCALMACHINE tab.
You can uninstall a program, if it is not uninstalled through the control panel, using the application Revo Uninstaller, which can be found and downloaded on the Internet. Launch it and scan the system for installed programs. Revo Uninstaller even reveals hidden services. You can also activate “Hunting Mode” in the program, after which a green icon will appear in the system tray. Click on it and move the cursor to the icon or folder of the application you are interested in, and the program will automatically remove it from the system.
If the program is not removed from the control panel and is disrupting the system, try using the System Restore service, which is in the list utilities in the Start menu. Specify desired point recovery, for example, the day before a malicious application was accidentally installed. Once the restore is complete, the system will return to the previous operating state, and malware will be missing.
In the Windows operating system, the same operation can be performed in different ways. Some people are used to managing computer resources using a mouse, others using a keyboard. To quickly remove folder, you just need to understand which method is the easiest and most convenient for you.
Instructions
To delete files from the Recycle Bin, move your mouse cursor to the “Recycle Bin” icon on the desktop, right-click on it and select “Empty Recycle Bin” from the drop-down menu. Confirm your actions in the request window. Alternative option: Open the Trash item and select the same command from the Common Tasks panel.
The very same folder can be removed in the following ways. Move your mouse cursor over unnecessary folder, right-click on its icon and select “Delete” from the context menu. In the request window, confirm the operation by clicking on the “Yes” button. The folder will be placed in the trash.
Another option is more suitable if you need to delete several folders at once. While holding down left button mouse, select the folders you want to delete. Repeat the steps described in the previous step.
If you're more comfortable using a keyboard, select folder that you want to place in the trash, press the Delete key. When the system asks you to confirm the operation, press Enter.
In the event that you cannot remember in which directory the folder is located, first use the “Search” component. Click on the "Start" button or Windows key, select “Search” from the menu. In the window that opens, set the search criteria and click the “Find” button. When the folder you are looking for is found, delete it using any of the methods described above, directly from the search engine window.
operating room Windows system allows you to easily operate any files, be it programs or user files. But sometimes the user is faced with a situation where he cannot delete a file.
First of all, try to understand why the file cannot be deleted. There are several reasons why you may not be able to do this. First of all, you may be trying to remove an important system file. The second reason may be an attempt to delete a file from a running program. Finally, the file being deleted may be a virus file that has anti-deletion mechanisms. If you need to delete or replace an operating system file, the easiest way to do this is by booting from a second OS - if you have one installed on your computer. If it is not there, you can boot using bootloader Live disk CD. This is a shortened but fully functional version of the operating system. It is useful in many cases - for example, if it is impossible to boot the computer from the main OS. With its help, you can also delete the file of your main operating system. But do this carefully - if you delete a file important to the OS, it may not boot. If a message appears that you are trying to delete a file from a running program, stop it. This can be done in the Task Manager (Ctrl + Alt + Del) or use any suitable program showing the list running processes and allowing you to stop them - for example, with the AnVir program Task Manager. This program will allow you not only to view the list of running processes, but also to see their location executable files and autorun keys in the registry. In addition, it shows the degree of danger of running processes. If, after deleting a file and restarting the computer, it appears again, we can say with a high degree of confidence that it is a virus file. To remove it, you need to find the autorun key and all components associated with the virus file. The virus can copy itself into several folders, so deleting one file and the launch key may not be enough. Especially if you have an infected program and every time you start it, the virus takes up residence in the system again. Therefore, the first thing you need to do in such a case is to scan your computer with an antivirus with new databases. To delete files that do not want to be deleted, you can use Unlocker program. This is a very convenient utility that is built into the context menu. Just click non-deletable file right-click and select Unlocker from the context menu. Then in the menu, select the option of your action with the file - delete, rename, move. Some Unlocker files cannot be deleted immediately, they will be marked for deletion and deleted during the next computer restart.
Video on the topic
How often do you find folders on your hard drive that you can't delete? The problem is really unpleasant. Sometimes such a folder does not contain a single item. Most often, this is caused by a system crash or a slight computer freeze. Also possible reason there may be a failed deletion of a file in this folder or a hidden or system file in this folder.
If you see the system message “The file cannot be deleted because it is open in another program,” don’t worry.
Anything is possible. I will give several options on how to delete files in such situations. First of all, pay attention to the following.
In 90% of such cases, the file you are about to delete is actually open to another program and just needs to be closed.
Sometimes it's a system error. You closed everything, but in her opinion, no. Then just restart your PC and try again.
How to find a file that is open in another program
If you know the name of the file, then finding it in the program (where it is open) is not difficult. First of all, look at the taskbar and tray.
If the application in which your file is open is not detected, press three keys “Ctrl+Shift+Esc” at the same time (it will start).
A window will open where you can see/close applications and processes, and then calmly delete what was previously impossible.
Uninstaller for deleting files opened in other programs
If the options described above for deleting files that are open in other programs do not bring a positive result, use a free uninstaller created specifically for such purposes - “”
After installation (you can download it from the official website: emptyloop.com/unlocker/#download), click on the application you want to delete with the right touchpad / mouse button.
After this, a tab will open in which there will be a line “Unlocker” - click.
Wait a few seconds. A small window will pop up. In it, click on the “no action” option, select “delete” and click “OK”.
Usually in such cases a notification comes that complete removal will be carried out the next time you start the computer.
This is of course not the only program, but from free analogues the toughest one – destroys everything irrevocably.
Therefore, before using its services, be sure to ask whether this will damage your computer system - subsequently, you may not be able to restore everything as it was before. Good luck - don't overdo it.
Category: UncategorizedWhen trying to perform any actions on a file or folder, the user may encounter the message “The operation cannot be completed because this file is open in another program.” This usually happens in a situation where required by the user the file (folder) is actively used by another application, therefore any operations to delete, move or rename this file become impossible. Below we will analyze the reasons for the error “The operation cannot be completed”, and also list options for solving it.
Typically, an error occurs in a situation when an application (including a system one) uses a user-requested file or folder in exclusive mode, which blocks any IO operations to delete, rename or move this file (folder).
Operations with the required file can be blocked either by any system process or tool (including the well-known “TrustedInstaller”), or by an external program installed on the PC, including virus software.
Often, the notification that appears that the file is open in another program and the operation will not be completed indicates which program (process) is occupied by the desired file. If there are no links to such a program, then it is likely that some system software is involved in blocking the desired file.
In some cases, removal desired folder may be blocked due to the presence of thumbnail files that look like Thumbs.db. These files are used to store thumbnail images used during work Windows Explorer. When attempting to delete such a file (or a folder containing such files), the user may receive the message mentioned above.
How to fix the “The file is open in another program” error
There are many ways to get rid of the error “The operation cannot be completed because this file is open in another program.” However, only a few of them actually work, which we will describe below.
Restart your PC in Safe Mode
Most in a simple way To fix the dysfunction that has arisen, reboot the computer in safe mode. Restart your PC, when you turn it on, quickly click on F8 to access the menu safe mode. Boot your computer in the specified mode and try to perform the necessary operations on the problematic file.
![](https://i1.wp.com/it-doc.info/wp-content/uploads/2018/08/5-5.jpg)
Use special software
Another way to solve the error that has arisen is to use special software, releasing access to the required file. Such programs include the popular “Unlocker”, “IOBit Unlocker”, or “Any File Remover”.
Usually, after their installation, they are built into the functionality of Windows Explorer. To activate them, you need to hover the cursor over the blocked file, right-click, and select from the menu that opens the specified program(for example, Unlocker).
![](https://i1.wp.com/it-doc.info/wp-content/uploads/2018/08/2-4.jpg)
It remains to be noted in this program the desired option(for example, “Unblock” or “Delete”), after which the problematic file will be released.
When installing such programs, remember that in addition to the main program, the installer may try to install additional software (bundling). Therefore, I recommend giving up automatic installation, and personally control the entire installation process by unchecking the installation options unwanted programs.
Enable Resource Monitor
You can also terminate the program (process) that is blocking access to the desired file. This can be done either by calling the Task Manager (click on Win + R, and there enter taskmgr. Go to the “Processes” tab and terminate the process of this program), and using resource monitor.
In the latter case, you will need to click on the “Start” button, write “Resource Monitor” in the search bar, and click on the match found at the top. After launching the resource monitor, go to the “CPU” tab, and in the search field on the right, enter the name of the blocked file. The system will find the specified file, right-click on it and select “End process”. Then you will need to delete the specified file.
![](https://i1.wp.com/it-doc.info/wp-content/uploads/2018/08/6-5.jpg)
Take advantage of the power of archivers
A fairly effective solution is to use the functionality of archivers (7zip or WinRAR level) to delete or rename the files we need. It is enough to launch the same 7zip, use it to enter the folder with the file, and rename or delete the desired file directly in the archiver. This usually helps to effectively solve the problem that the operation cannot be completed.
Remove thumbnail files
As described above, the presence of files with the .db extension in the folder being deleted may prevent its deletion. In this case, you need to close the problematic folder, run a command line as an administrator, go to the disk with the problematic file (for example, if it is C, then type in the line WITH:).
Then at the command line type:
del /ash /s thumbs.db
And press enter. After completing the procedure for deleting these files, try deleting the desired directory.
![](https://i2.wp.com/it-doc.info/wp-content/uploads/2018/08/3-4.jpg)
- To disable further creation of thumbnail files in Windows, you need to click on Win + R, and there type gpedit.msc.
- In the window that opens, follow the path “User Configuration”, then “Administrative Templates”.
- Then "Windows Components".
- Then “Explorer” and find the option “Disable caching of thumbnails in hidden files...”.
- Double-click on it, and after opening its window, select “Enabled” on the left and click on “Ok”.
![](https://i0.wp.com/it-doc.info/wp-content/uploads/2018/08/7-4.jpg)
Check your system for viruses
And, of course, it doesn’t hurt to check your PC for malware that can block access to the files they need. This will help online check computer for viruses: .
Conclusion
The occurrence of the message “The operation cannot be completed” usually means that some program (process) is blocking user access to the desired file. The easiest way to solve the problem is to restart the PC and use specialized auxiliary tools (the “Unlocker” level) to easily restore access to the required files.