The file is occupied by another program and I cannot open it. What to do if the file is busy or in use


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 are 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 to work in the same way " block - read - unblock." However, there are times when a 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 this moment open in one program or another. Since the list can be quite long, and we only need information on 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/file— full path to the desired file. In order to enter it, you just need to drag the desired file into 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 user program, and not some utility service, you should first try to shut down its work regular means, through GUI. If this cannot be done, you can sequentially try several options available in the window System monitoring. Select the required process and go to the View menu - Send a signal to 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 standard signal, which 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 but nothing happens, you are most likely sending a signal normal completion(SIGTERM) or interruptions (SIGINT) work, and in some cases they can 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.

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 the 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 look at normal situation with popular applications for downloading 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 finish 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 V Word Pad. This program is mostly just a viewer and does not allow full editing of the content. 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 using 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, it is system 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 perform a 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 completing 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 official resource companies).

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 blocking can be done precisely at the level of the operating system, not to mention insufficient rights or exposure to viruses. We are not talking about viruses now.

Recovery full access The simplest solution is to use special utility Unlocker (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 just download official version, install it or use the program as a portable utility that 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 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 only experienced users are recommended to engage in such operations, since lowering the security level will automatically deactivate some important system security elements.

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. Most main conclusion, which can be concluded 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.

this often happens when certain files are not deleted. And the system writes that this file or the folder is occupied by another process. This can happen both in Windows XP and in Windows 7, 8, 10. Today we will look at troubleshooting methods similar problem, When files are not deleted.


So, imagine, you installed some program on your computer, used it, and you didn’t like it. What are your actions? Of course, delete it. After uninstallation, the program was allegedly removed, but the folder with some program files remained. When you try to delete such a file, an error appears:



Let's look at ways in which you can delete files that cannot be deleted using standard means.

1st method. Simplest
If the file is not deleted, restart your computer and try deleting again. In many cases this helps. If the problem persists, then read below.

2nd method. Task Manager
In the Windows 7 and XP operating systems, to get to the Task Manager, you need to press the combination Ctrl keys+ Alt + Del.
In Windows 8 and 10, just press the combination Windows keys+ X and select Task Manager from the menu that appears.



The Task Manager we called will open, where you need to find the process that is using the file and remove the task from it. Then try deleting the file again.



3rd method. Using a boot disk or flash drive
The next method is to start the computer from a LiveCD or bootable USB flash drive and then delete the file or folder. In the first case, we need to use a standard graphic Windows interface to find and delete the required file, or use the command line. If you use bootable USB flash drive with Windows 7, 8 or 10, then during installation you can open the command line by pressing Shift keys+ F10. There is also “System Restore”, thanks to which you can return the computer to its previous state. By the way, the drive letters may be different, so use the dir c: command to display the contents of that drive. Thanks to this, you can easily understand what kind of local disk it is.

4th method. Deleting files in safe mode
It's very simple here. You need to go into safe mode, find the required file or folder and delete it. In safe mode, only operating system programs are launched, while all your installed third party utilities(messengers, drivers, antiviruses, etc.) do not start. Therefore, the probability of successful removal required file very high.

5th method. Usage special program Unlocker
This program, called Unlocker, helps delete files that are used by some process. Very useful utility, coping with her tasks with a bang. You can download it at https://yadi.sk/d/PkczjpOKjbeje

When the program downloads, install it.



Next, select Advanced and uncheck all the boxes,



The essence Unlocker programs- unloading from random access memory processes that are used by the file. The program can find and terminate a process that is even hidden in the Task Manager. All in all great utility, which every system administrator should have.

Sometimes when you try to delete a file, a notification appears that the file is occupied by another application and cannot be deleted. The reason for this is that there is currently a process going on in the operating system that uses this file, so deleting it is impossible. Of course, it is very unpleasant when it is impossible to delete a file on your own computer. But this does not mean that it cannot be removed altogether.

You will need

  • - Computer with Windows XP OS;
  • - Unlocker program.

Instructions

  • In order to delete this file, you need to close the program that uses it. If you know what program it is, then do so. Press the key combination Ctrl+Shift+Esc. If you are using an operating room Windows system XP, the task manager will appear immediately after pressing these keys. Or press the key combination Ctrl+Alt+Del and a window will open. In this window, select "Task Manager".
  • After opening the task manager, go to the “Processes” tab. Then in the “Description” section, look for the name of the program. Once you find the program, click on it right click mice. A context menu will appear. In it, select “End process”. A window will pop up warning you about possible data loss. In this window, also click “End Process”. Once the process is completed, you can safely delete the file as it is no longer in use by any process.
  • If you have no idea what program may be using the file you want to delete, then you first need to know the name of that program. This can be done using the Unlocker program, which is completely free. Download it from the Internet and install it on HDD computer. You don't need to run Unlocker. After installation it will start automatically.
  • Now right-click on the file you want to delete. Next in context menu select Unlocker. A window will appear. This window will contain information about the process that is blocking file deletion. Click on this process with the left mouse button. Then, at the bottom of the window, click on the “Kill process” option. Wait a few seconds. The program window will close. Now the process that was blocking the file deletion has been removed. Right-click on the file and select “Delete” from the context menu.
  • On Windows of any version (XP, 7, 8, 10), a problem often arises when a file or folder with a locked file is not deleted. A message pops up that the file is occupied by another process or is open in some program, or you need to ask permission from someone.

    There are several ways to delete a file that is not deleted, renamed, or moved. This is done without additional software, by using free program Unlocker, from a bootable USB flash drive or LiveCD, or the DeadLock program.

    When deleting locked files and folders, be careful; it may be part of the operating system. Without them, Windows will stop loading.

    Why isn't it deleted?

    • The file is open in another program. Terminate any unnecessary processes and try again. Sometimes restarting the computer helps.
    • Insufficient permissions to delete. For example, this file was created by another user or the computer administrator removed the deletion rights.

    Exceptions

    The methods described in the article will not always help:

    • pagefile.sys and swapfile.sys - to remove, disable the swap file.
    • hiberfil.sys - deleted when hibernation mode is disabled.
    • If an access denied message appears. You need to become the owner of the file or folder. The easiest way to do this is with the TakeOwnershipPro program.
    • If a message appears asking permission from TrustedInstaller. This is protection against the removal of system components.
    • Windows.old - folder with old version operating system. It is deleted through the “Properties” of the local drive C. On the General tab there is a “Cleanup” button. A window will open in which select “Clear system files" After the analysis is completed, the “Previous” item will appear in the list in this window. Windows installations" Check this box and click OK.

    Deleting the file manually

    Message: The file is already in use, please close and try again.

    If a file doesn't want to be deleted, the error message usually tells you which process has locked it. This could be explorer.exe or any program that has it open. If you close this program, the file will be deleted.

    If the file is occupied by the explorer.exe process

    • Before completing the task, open Command Prompt as an administrator. It is located in “Start - All Programs - Accessories”. Right-click on Command Prompt and select Run as Administrator.
    • Remove the explorer.exe task in the task manager and write it in command line del full_path/name.extension.
    • The path does not have to be entered manually. Right click on the required file with Shift held down - Copy as a path and paste it into the command line via the right-click context menu.
    • Now restart explorer.exe. In the task manager, click "File - New task- explorer.exe."

    Use a bootable USB flash drive or disk

    If you have a bootable USB flash drive or LiveCD, or disk Windows recovery, run them and quietly delete the file standard method or via the command line.


    Be careful sometimes when entering through boot disk local disks have different letters. To see a list of folders on drive C, type dir c: on the command line.

    If you use a bootable USB flash drive or Windows installation disk, the console opens at any time after the language selection stage, using the key combination Shift + F10.

    You can also select the system recovery mode, which will be offered before starting the OS installation.

    Command for deleting via the console: del full_path_to_the_file.

    Using DeadLock

    The free DeadLock program allows you to delete a locked file and change the owner. Download from the official website: https://codedead.com/?page_id=822.

    Using the File menu, add the problematic file to the program. Right-click on it in the list - unlock it (Unlock) and delete it (Remove).


    Using Unlocker

    The simplest and popular program, but now even the official website displays a warning about unwanted software. Along with the program there may be some other virus or advertising, so use at your own peril and risk. Try the methods above first. Website: http://www.emptyloop.com/unlocker/.

    After installation, it will appear in the context menu new item, which is called Unlocker. After clicking the button, the program will complete the interfering process and the file will be unlocked.


    If you want to delete a folder, first delete all its contents.

    Via command line

    There was such a case that the file did not want to be deleted in any way. The size was 0 bytes, the name was written in Russian letters (not supported in older MS-DOS versions), there was a Read-only attribute and an A attribute (reading only and adding content). The command line helped.


    That's all for now. If you know simpler and effective ways, write them in the comments. Which method helped you?





    

    2024 gtavrl.ru.