Why does it write that the file is busy with another program? How to delete a file that is occupied by another application? Force termination of a blocking process

When a file is opened by one program or another, access to it is temporarily blocked. Typically the lock lasts only until the contents of the file have been read and transferred to RAM, which usually does not take much time, and after that the file can be accessed by any other application or service in order to work according to the same “lock-read-unblock” scheme. However, there are times when the program retains the lock even after reading the file. This can happen either by mistake or due to the specifics of the program itself. In any case, further interaction with this file will be impossible, and attempts to edit, delete, move or open it in another program will result in various messages indicating that the file you are looking for is blocked, inaccessible, in use, or even that you do not have enough rights to access it.

The easiest way to resolve this issue is to terminate the application that is preventing further interaction with the file. But figuring out what exactly this program is can be quite difficult, because the “culprit” could be some background process. You can cope with this task using terminal.

The "lsof" command displays a list of all files that are on at the moment open in one program or another. Since the list can be quite long, and we only need information about one file, we can filter by its name. To do this, launch Terminal from the Utilities folder and enter the command lsof | grep filename Where filename— name of the file you are looking for.

As an alternative, you can use the "fuser" script included with OS X. This script also uses the "lsof" command, but its output is easier to read. The script checks whether the file you specify is currently in use, and, if so, by which process.

Run Terminal from the Utilities folder and enter the fuser command /path/to/file Where /path/to/filefull path to the desired file. To enter it, just drag and drop required file out the window terminal.

Once we know the process ID, we can start Resource monitoring and determine which program it corresponds to (to simplify your search, you can sort by PID by clicking on the title of the corresponding column). If the required ID is assigned to a user program, and not to some utility service, you should first try to terminate its operation regular means, through GUI. If this cannot be done, you can sequentially try several options available in the window System monitoring. Highlight required process and go to the View menu - Send a signal to the process. Then select one of the signals described below from the drop-down menu and click the “Submit” button. Alternatively, again, you can use Terminal.

1. Lost connection (SIGHUP)

This signal will force the process to release the resources it is using. Typically, the result is that the program simply updates its configuration and continues to work. To send such a signal using terminal, enter the command kill -1 PID Where PID— Process ID that we found out earlier.

2. Terminate (SIGTERM) and Abort (SIGINT)

This is the standard signal that the command receives upon normal completion of its work. In this case, the program will first save all changes and its configuration, and only then exit. To do this in the window terminal you can enter one of the commands below.

To end: kill PID or kill -15 PID

To interrupt: kill -2 PID

3. Force quit (SIGKILL)

If you are trying to terminate a program and nothing happens, you are most likely sending a normal termination (SIGTERM) or interrupt (SIGINT) signal, which in some cases may be ignored. To get around this you can try to force quit problematic application using the "SIGKILL" signal. To do this using terminal, enter the command: kill -9 PID

Once the problematic program is closed, you will most likely be able to freely interact with the file in question and open it in any program of your choice.

If the above steps do not work, you can always restart your computer, which may also solve your problem.

For the original material that served as the basis for writing this article, we once again thank Christopher Kessler.

Any computer user has at least once encountered a situation where, when trying to delete a folder (or file), the Windows operating system does not allow this, displaying a message stating that they are open in another program.

It would seem that there is nothing simpler: just close everything active applications and obstacles to deleting an unnecessary folder will be eliminated. But it often happens that even after closing all programs, the operating system still gives out the same annoying message.

There may be many reasons for this, the main ones being the following:

  • system error;
  • actual use of the object by another program;
  • data corruption;
  • use of a folder or file by the system;
  • presence of viruses or malicious files.

And deleting unnecessary objects is often simply necessary, since they take up space and sometimes can even significantly slow down the performance of the entire system as a whole. What to do in such cases?

How to delete a folder if it says that it is open in another program

If, after closing all programs and applications, the operating system continues to believe that the folder is occupied by another process, you will have to use more complex actions to delete it. There are several ways to solve the problem:

  • using the task manager;
  • application special utility;
  • entering safe control mode;
  • using the console and special commands.
  • Since the reason why a folder cannot be deleted is not always obvious, you will have to apply these methods sequentially.

    Often the best answer to this question is simple reboot computer. It’s not for nothing that professional programmers have a saying: “seven troubles – one reset.” Often after restarting any version operating system Easily allows you to remove unnecessary objects.

    Using Task Manager

    If even after a reboot the notorious message continues to appear when trying to uninstall, then most likely some program or application continues to work in “hidden” or “sleep” mode.

    In this case, turning to the built-in system manager tasks. It is called by pressing the key combination “Ctrl”, “Alt” and “Delete”. In the window that appears, all running applications and work processes.

    By switching between the corresponding tabs, you can stop the operation of a particular program by right-clicking on it.

    If it is not known which program is using the folder being deleted, then in an efficient way is to stop all running applications (“cancel task”). Then you should try to remove it again. There are still questions on the topic of how to delete a folder on a computer if the system says that it is open in another program, then read on.

    Pay attention! Sometimes problems with deleting unnecessary objects are associated with blocked rights. Sometimes Windows requires the user to have higher hierarchical authority for operations with certain objects. In this case, you must log in as (or with rights) an administrator and the operation to delete the required objects will be successful.

    Application of special programs and utilities

    If the methods listed above do not have the desired effect, you can use specialized program. One of the most popular, powerful and effective free utilities Unlocker is of this kind.

    Using this uninstaller is quite simple. After downloading and installing the program, when selecting an object to be deleted, right click mouse, the corresponding line appears in the drop-down context menu. All you have to do is click on it, select the “no action” option, click “delete” and confirm by clicking “ok”.

    After the manipulations performed complete removal The junk folder should become accessible after a reboot.

    Other ways to delete folders and files

    There are also alternative methods deleting files and folders that require certain knowledge in using a computer, special programs and system files.

    1. Using Safe Mode. The advantage of this method is that it is safe Windows mode does not load system dialog libraries. This is important in cases where the system is infected with a virus. To log in, you must press the F8 key several times when you turn on the computer. Then you need to select “safe mode”. A black screen should appear, without wallpaper or other embellishments. Now you can try to remove unnecessary folder in the usual way. After which you need to reboot the system.
    2. System rollback. When you click “Start” - “Run”, a command line appears, into which you need to enter the command “msconfig” and click “ok”. The “System Configuration” window will appear on the monitor. In the “General” tab, select “Run system recovery”, then “Restore more than early state computer”, then – “Next”. On the calendar that appears, you need to select a date on which the folder to be deleted did not yet exist. This operation may lead to the loss of some information, but personal and system ones will not be affected.
    3. You can try typing in the command line line chkdsk c:/f/r and press Enter. Here "c" is the drive name. If the non-deletable folder is on another drive, then you need to enter its name. After the disk scan is completed, its results will be displayed on the monitor. Next, enter the command exit and press the Enter key. After the system reboots, you can try to delete the folder in the usual way.

    Thus, to solve the problem with the inability to delete a folder or file when the Windows operating system ( latest versions, starting with XP) writes that they are busy with another program, you can various methods. Try to perform the operations listed above in order. Most likely, one of the methods will achieve the desired effect!

    Windows systems are so specific that they can use some system or even user components completely unpredictably, and when trying to access some element, the user is given a message that the file is in use by another program. Few people know what to do in such a situation. Most try to either end active processes in the Task Manager or force a restart of the computer. Such actions are not always appropriate, especially if you do not know exactly which process is currently using the file. Below we offer several typical situations with solutions to correct them.

    Why can file objects be used at the same time?

    Let's start with the basics and look at the operating system itself. Why does it say “The file is in use by another program”? The user is absolutely sure that he does not use the object selected for opening or viewing in several applications at the same time.

    The most main problem is that the user himself can be inattentive, and the operating system can use the same file for its own purposes (even several system services, the operation of which the user is not even aware of). If you know the name of the file, simply close it via the command line as shown above.

    The simplest examples of simultaneous file access

    To understand the situation as fully as possible, let's look at a few typical examples. First, let's consider the usual situation with popular applications to download torrents.

    The user set the content to download, but forgot about it and is trying to delete the original torrent file. Naturally, the system tells him that the file is occupied by another program. What to do in this case? First you need to either wait for the download to complete or complete it early. The original item or partially downloaded content can then be safely deleted.

    You can often encounter situations where the user edits the same office document V different applications. Suppose you have opened text document in Word Pad. This program is mostly only by viewer and full editing does not allow content to be produced. Naturally, the user immediately opens the document in Word, forgetting to close Word Pad, makes changes, and when trying to save, receives a message that the file is in use by another program. What to do, I think, is already clear. Close the first program, after which saving will become available.

    The situation with the use of device drivers looks somewhat worse, especially if they are virtual. For example, you have a Kontakt software player, which is installed on the system not only as a plug-in for VST or RTAS formats, but also as a Standalone application (working independently of the connected host). You open some sample in it, and after that you launch the same plugin in the DAW studio and try to load it into the VST version of the player. It is clear that in one of the programs you will receive an error. In particular, the problem here is that both the studio and the player cannot simultaneously access the ASIO4ALL drivers. And again a message will appear stating that the file is in use by another program. How to open such content? Again, the solution on the surface is to terminate one of the applications. But these are only the simplest situations that can be encountered. Now let's see how to fix them and eliminate any errors that may arise.

    The file is occupied by another program: what should I do first?

    As already mentioned, many try to force a system restart without completing the blocking process. This should not be done under any circumstances, unless, of course, this is a systemic process.

    In the case of user data, there will be nothing wrong with a reboot. How to restart your computer? Elementary! Even a forced restart is not required. Just follow standard reboot through the “Start” menu or through the “Task Manager” (you can even do this without killing active processes).

    The file is occupied by another program (Windows 10): how to kill blocking processes?

    But you can do it differently by ending the unnecessary active process. To do this, if you have at least a preliminary understanding of which processes can use the object you are looking for, you can use the tools of the “Task Manager”, in which one of the services is terminated.

    If the user has no idea what applications are occupied by the file, it is better to use the utility Process Explorer, developed by Microsoft Corporation (you can download it directly from the company’s official resource).

    What to do if files are not deleted?

    How to restart your computer or shut down unnecessary processes, figured it out. Now let's look at the problem that the above message appears when trying to delete files. Access can be blocked precisely at the level of the operating system itself, not to mention insufficient rights or the impact of viruses. We are not talking about viruses now.

    For recovery full access The simplest solution is to use a special Unlocker utility (with Windows 7 the situation is much simpler, since in some modifications this application is built into the system (pre-installed applet). In any other case, you can simply download the official version, install it or use the program as portable utility, which does not require installation.

    Access rights

    Finally, to delete selected objects, you can use the option to give yourself full rights to edit and change files and folders.

    To do this, you need to use the properties section, called via RMB on the selected object with changing the owner or adding a specific user to the administrator group, after which you just need to check the boxes on all available items.

    At the same time, if access is blocked even after this, you can use Windows search, find the registration control section UAC entries, entering the desired combination in the search field, and then lower the level by moving the slider to the lowest position. But it is recommended to engage in such operations only experienced users, since lowering the security level will automatically disable some important elements system protection.

    Brief summary

    In general, this is where we can put an end to the question of how to fix the “File is in use by another program” error. The most important conclusion that can be drawn from all of the above is that it is not at all necessary to perform a forced restart of the system. You can also use more sophisticated methods to eliminate problems that arise. But here everything depends solely on the current situation and on what specific actions need to be taken at the moment.

    I was looking at my work calendar when Outlook 2010 suddenly reported an error and closed. After restarting, it was unable to open the OST file, and today I will tell you how I solved this problem in three minutes.

    When launching the program, it gave the following error:

    At work, I have an OS and programs with an English interface, so I will provide the equivalent error text from the Russian version of Office.

    Exited Microsoft Outlook without closing the file properly Outlook data. You need to restart Microsoft Outlook. If the error persists, contact support.

    The message was not very informative, but the launch mail client V safe mode while holding down Ctrl key, didn't change anything.

    I opened the program folder and launched the diagnostic utility scanpst.exe. She couldn't fix the problem, but she gave a specific direction to search.

    The essence of the message was that the OST file was occupied by some other application, which was an obstacle for Outlook. Have you already guessed which utility I launched next?

    This solved the problem! Mail program started up fine and I was back to work.

    What to do if your webcam is being used by another application

    In the comments, reader Igor asked if it was possible to use Process Explorer to determine which application is using the webcam. Yes, the process is similar, but you need to look for:

    I know that Unlocker exists, but I still had to download it, and Process utility Explorer was at hand. Moreover, the morality of the recording is not only in these two programs. After all, before using them, it was necessary to find the cause of the problem.

    Upd. 11-Mar-13. I would like to supplement the note with points that emerged in its discussion:

    • If you don't have anything at hand, you can try to rename the file. Explorer can suggest a program that uses it.
    • In Windows 7 and higher, you can use the built-in Resource Monitor (resmon) program, where there is a search for descriptors on the CPU tab.
    • Utility

    It's no secret that in Windows systems programs can use some files at the same time. As a rule, this applies system components, and when opening some application to which such a file is associated, or when trying uninstall Windows informs the user that the system or user file busy with another program. What to do? Is it a game, a torrent application or even a regular one? office editor, - doesn't matter. This does not change the essence of the problem. But let's see what can be done in such a situation.

    The file is occupied by another program: what does this mean?

    Actually, the essence of the issue is that a certain component is currently using not one, but two or more applications. In particular, this applies not only to running user programs, but also system services running in

    As a rule, the problem of a file being occupied by another program when trying to access it mostly concerns device drivers, but there are exceptions. In the very simple case An example can be given where a user simultaneously opens a document, say, first in Word and then in WordPad, and tries to save changes in one of these applications. Naturally, the system begins to, as they say, spit. The same applies, for example, to cases of using a webcam, when the priority is assigned Skype program, and the user tries to launch another application, which in theory should also use it. And these are not isolated cases.

    Quite often other situations occur when the file is occupied by another program. What to do? The torrent file cannot be deleted! Why? Yes, simply because it is in the stage active download in the application itself (BitTorrent, uTorrent, etc.). You can get out of this situation quite simply by completing the download or distribution in the program or simply from the list. But this is the simplest thing that can be. Usually the situation is much more complicated.

    The file is occupied by another program: what to do in the simplest case

    As a rule, most ordinary users do not particularly want to delve into the essence of what is happening. The system reports what almost all users of this contingent know.

    What exactly? Right! They simply reboot the computer. By the way, this primitive method helps in absolutely all cases, however, this only applies to the completion of active processes associated with the system itself. If the work was carried out with documents in which changes were made, there is no need to talk about any preservation. And many people simply don’t take this into account, and then start

    Force termination of a blocking process

    The best option to get out of this situation would be to check the blocking process. How to find out which process is using a file? Yes, very simple! To do this, you should use the well-known “Task Manager”, which can be called combination Ctrl+ Del + Alt (Ctrl + Esc + Alt) or the taskmgr command from the Run menu (Win + R). If the user even approximately understands which application can access the file at the moment, you just need to find it in the list of active processes or services and force the process to end using the corresponding button or through context menu right click.

    But this method is only suitable for those cases when it is possible to guess which process can access the the specified file. But if you don’t have even an approximate idea, it’s better to use a utility that can be downloaded from the official Microsoft resource.

    Problems deleting files

    Quite often situations may arise when the system, when trying to delete it, reports that the file is occupied by another program. We’ll look at what to do a little later, but for now a few words about which components may be impossible to remove.

    Most often this concerns system components that are vital for Windows operation or partially related to these processes (although there are other situations). At the same time, no help administrator rights no matter how hard you try (the system itself blocks actions that could harm it). However, even in such a situation there is a way out. There are at least two options.

    Using the Unlocker utility

    So, the system reports that the file is occupied by another program. What to do in this case? You can use a unique Unlocker utility. In some Windows builds it is already there from the very beginning. If it is not there, the application will have to be downloaded and installed.

    After this, the program integrates its own command lines in the right click menu. Now you need to call up this menu and use the Unlocker command, select the process in the application window, and then click the “Kill process” button at the bottom. Once completed, you can perform any operations on the file.

    Changing access rights

    Now let's look at another situation with attempts to delete some data. In this case, the system also reports that the file is occupied by another program. What to do in such a situation? To delete so-called non-deletable files and folders, you just need to grant yourself the necessary rights.

    This can be done by right-clicking on the object in the properties section. Here you will need to go to the security tab, click the “Advanced” button and change the current owner, then return to the previous window and use the “Change” button, and then in the menu check the boxes opposite all the lines in the list.

    Once all these operations are completed, the file can be deleted without problems.

    Other situations and solutions

    It also happens that games don’t want to work. Again, the system reports that a file is occupied by another program. What to do? SpinTires (a truck racing simulator) also gives an error that the files are different from the original.

    In this case, this can only mean that the game was downloaded from an unreliable source, and therefore both launch and access to online playthrough are blocked. The solution may be to re-download official version or installing special “fixes” to eliminate problems with operation.

    Conclusion

    As we can see, the situation is not critical. If for some reason the system reports that the file is occupied by another program, what to do and what decision to make to fix the problem can be understood from everything proposed. Actually, any method the user chooses can solve this situation. What to prefer? Many people advise using Unlocker, since this is the simplest solution, because constantly terminating some blocking process can become quite problematic. In some cases, you can use optimizers with fine tuning startup, but if you exclude some important system processes from it, there is no guarantee that Windows will work correctly or will boot when you start it again. And this is even if most of these applications are not believed to cause harm to the system. In general, in any case, caution does not hurt, so be vigilant.