How to delete a file if it is busy. Delete a file or folder that is not deleted. Using the command line

You can delete a folder by right-clicking on it and selecting delete from the context menu. But sometimes this method does not help and I cannot delete the folder, so I will describe several ways to delete the folder.

Deleting a folder using the command line

To delete Windows folder do the following. Click "Start" - "All Programs" - "Accessories" - "Command Prompt". A window will appear in which if you add Help and press "Enter", a list of commands and a description about each command will appear, the RMDIR command is deleting a folder through command line. To learn how to prescribe the command you need, for example, deleting a folder, you need to add Help RMDIR. The system answered us how to write a command to delete the folder. RMDIR [drive:]path. I want to delete the remnants of the game paradise in the RAI folder and I got this command. RMDIR /S /Q C:\Games\RAI.

Delete folder via command line

Press "Enter" and the folder will be deleted immediately.

Deleting a folder using bat file command

So we figured out what the command for deleting a folder looks like. There are folders that reappear after a while. Here, to remove them, you can create a BAT file on the desktop, because this folder, which we do not need, will be deleted when the bat file is launched.

how to make bat file

Right-click on an empty spot on the desktop and select "New" - "Text Document" from the context menu. Open this text document that appeared on the desktop. Enter the RMDIR /S /Q C:\Games\RAI command there, where C:\Games\RAI is the path to your folder. The entire path must be in English, since the bat file does not start if there are words in Russian in the written bat file. Now click "File" - "Save As". In the window that appears, in the file name line, write 1.bat and click "Save".


In 1.bat rename the file

An example bat file will appear on your desktop. Now run 1 bat file and bat delete the folder instantly.

Deleting the Windows old folder

Some put the system by skipping formatting the disk and they have a folder with system files old windows this folder is usually called Windows old. Many do not know that the Windows old folder can be deleted. You can delete the old windows folder by cleaning up the disk in Windows 7. Click "Start" - "All Programs" - "Accessories" - "System Tools" - "Disk Cleanup". A window will open in which you need to select the drive on which the Windows old folder is located and click "OK". The disk will be scanned and a window will appear in which we click "Clean up system files". In this window, put a tick in the item "Previous Windows installation” and click “OK”. The message “Are you sure you want to permanently delete these files” will appear, click “Delete files”.

Removing windows old

System files will be removed from the Windows old folder and now you can simply delete the Windows old folder.

Delete folder with admin rights

Sometimes the folder is not deleted and the message “You need permission to perform this operation” appears, and in order for the folder to be deleted, you need to allow full access in the folder properties. To do this, do the following. Right-click on the folder and select "Properties" from the context menu. Go to the "Security" tab and click "Advanced". In the new window, go to the "Owner" tab and click "Change".


We will change the owner of the folder

An owner window will open in which you need to select your administrator name (but not administrators), check the box "Replace the owner of subcontainers and objects" and click "Apply".


Changing the Owner of a Folder

In the message that appears, confirm and become the owner of this object. From the "Owner" tab, go to the "Permissions" tab and click "Change Permissions". In the window that opens, select the name of your administrator and click "Change". A window will open in which we put a tick in the item "Full access" and click "OK" this window will close, and in open window tick the boxes:
"Add Permissions Inherited from Parent Objects."
"Replace all permissions of the child object with permissions inherited from this object" and click "OK".


Allow full access to the folder

Again, a message will appear with which we agree by clicking "OK" and close all windows by clicking "OK". The folder can now be deleted.

Deleting a folder in Total Commander

Permanently delete a folder in Total Commander very easy. You need to find the folder you need to delete and click on it with the left mouse button, and then click the delete button at the bottom of Total Commander or press F8 on the keyboard and a message will appear in which we click “Yes” or “Delete”, depending on whether the folder is empty or what that is.


Search and delete empty folders in total commander

The folder will be deleted along with all its contents.

Program for forced deletion of folders

I like Unlocker folder remover.

Install and the program for deleting undeletable folders will be in the context menu. Right-click on the folder to be deleted and select Unlocker from the context menu. A window will appear in which set the action "Delete" and click "Unlock all". The folder will be deleted.

If you do not have time to delve into the situation, just restart your computer. In many cases, after a restart, the problematic folder can be deleted in the usual way.

If when trying uninstall Windows reports that it cannot find the element to be deleted, the archiver can help you. 7Zip, WinRAR or a similar program will do. Run it and archive the problematic folder, having previously checked the option "Delete files after compression". The program should automatically delete the directory, and you will only have to delete the created archive.

3. Delete the folder via administrator account

The inability to delete a directory may be related to permissions. In such cases, the system requires a password from the administrator account or simply reports the lack of necessary rights. To get around this limitation, you will either have to enter the requested password immediately, or log in as an administrator and only then delete the folder.

Viruses and other malware can also prevent the folder from being deleted. using an antivirus, then try to get rid of the directory again.

5. Check that there are no locked files inside the folder

Often, deleting a folder does not work due to the fact that the files attached to it are used by certain programs. Checking if there is such a conflict is very easy: open the directory, select the internal files and try to delete them. If the system refuses to delete one or more objects, using the system tools or third party programs. Then delete the folder itself.

If the standard explorer refuses to delete the object, try doing it in a third-party file manager. For example, in Total Commander (Windows) or Commander One (macOS).

7. Delete folder in safe mode

If other methods do not help, find the problematic directory and delete it.

Hi all. I propose to talk today about files that are not removed from the computer. After all, there are always a lot of files on the computer, you download them from the Internet, dump them from a USB flash drive, create them yourself. Each user periodically deletes junk files. Someone does it just to free up disk space, someone for security purposes, and someone just keeps their computer in order. But it happens that the selected file is not deleted. The system writes that there is no access to it or it is busy with another process or is being used by another program. Also, sometimes a file is not deleted from the computer due to the fact that you do not have sufficient rights to do so.

Is it possible to delete such files from the computer

If you are wondering how to delete a file that is not being deleted, then you probably have good reasons to destroy it. But you need to be careful and pay attention to what these files are and in what folders they are located. Often novice users want to free up more space on their hard drive, so they go into system files and try to delete what is being used by the operating system. Even such files can be deleted, but this will lead to errors in the operation of the computer or make it impossible to boot it. And in fact, it will free up a very small amount of space.

Before deleting a file, you should analyze what it is responsible for and how it ended up on your computer. If you downloaded the program, installed it, but now want to delete the downloaded files, then you will not always succeed. They can still be used by the system until the next reboot. Everything that you personally downloaded from the Internet can be safely deleted. But sometimes such files may not be deleted. Let's figure it out.

The easiest way is reboot

If the file is not deleted from the computer and you see a message that it is being used by a process or program, then you need to restart the device. The main point here is that it is actually used by a program or process, you can't see it, but the computer uses the file in its work. For example, you opened a photo in a photo editor and made some changes, after which you saved a new one and closed the program. But when trying to remove old file problems arise. This is because you closed the program, but the process hung and did not close, the photo is attached to this process and you have no way to delete it. In other words, the system crashed.

As a rule, restarting the computer closes all processes and programs, frees RAM from unnecessary information and you are calm, in a standard way, delete the file from the computer. Therefore, it makes sense to start deleting from the very easy way, only after that proceed to further attempts.

End the process manually

It is not always possible to restart the computer, because in this moment the programs you need may be open and you do not want to start your work from the very beginning. In this case, you can try to end the open process yourself that uses the file to delete. The uninstall error message usually indicates which program or process is using the given file. Therefore, you need to go to the task manager, find this file and end it.

Press key combination Ctrl+Alt+Del and select " Task Manager».

Launch Task Manager

After that, you need to go to the tab " Processes”, find the process that was displayed in the error message. If there is such a process, then you right-click on it, select the item " End Process" or " End task". After the process is stopped, you can make another attempt to delete the file, if everything was done correctly, then the file should be deleted from the computer without the need to restart.

Select "End Process" or "End Task" (depending on your OS)

File cannot be deleted due to insufficient permissions

Another common mistake when deleting is that you do not have access rights to perform this operation. This happens often enough that you may encounter this problem. If the file is not deleted from the computer due to lack of access, then you need to analyze what kind of file it is. We decided that everything on the computer should not be deleted, if you did not create and download this file, then it does not always need to be deleted.

The thing is that the developers of the operating system have foreseen that inexperienced users will try to remove what is not worth deleting, as the computer will stop working. That is why some system files are in a special legal field, only the system can get unlimited access to them, only it can change them and delete them. Therefore, you can delete such a file only by booting through live CD or having received the rights of the system. You can do it, but is it worth it?

In order to perform further actions with such a file, you need to know what you are trying to delete. If you have a certain system file name in front of you, then you can find information about it on the Internet without any problems and immediately understand whether you can delete it or it is better to leave everything as it is. Very often, viruses are hidden under such system files, so they must be removed using an antivirus program.

Deleting files by booting from LiveCD

Sometimes rebooting and ending various processes do not give you any positive result, the files are still not deleted from the computer. In this case, there is a win-win option, but it is available for more experienced users. But even a beginner, with a great desire, can figure out this method and implement it on his own. Its main essence is to boot under another, independent operating system, go to file system and delete all unnecessary files.

In most cases, your operating system does not allow you to delete this or that file, which, in her opinion, is very necessary for her. This is necessary to protect system information. It is the OS that does not give you access rights, it is the OS that uses the files in various processes and programs. The file itself is simple information on the disk, so it is quite easy to delete it without an OS. But initially you need to make a bootable disk or USB flash drive from LiveCD.

There is a lot of information on the Internet regarding that and the disk, so you will not have any problems. Once you boot from such a system, you can do whatever you want with your files on disk. But remember that now there is no right to make a mistake, if you delete something that was not worth it, then the computer will not be able to boot normally or it will work with errors.

How to delete a file with Unlocker

If the file is not deleted from the computer and you see various errors in front of you, then Unlocker program. It's perfect free program, which you can easily download from the official website. The program is lightweight and installs in a few seconds. Immediately after installation, a new item appears in the context menu that appears when you right-click on a file.

When you right-click on a file, a new item appears

By clicking on this item, you will see a program window asking you to choose what needs to be done with this file. In the drop-down list, you need to select the delete command and then say goodbye to the file. The program bypasses most of the obstacles in deleting a file and performs the task without any problems. But again, you need to be careful what you do. You must understand that this way you can delete system files without problems and obstacles, which is not a good idea.

Also pay attention to the fact that viruses are often spread under such programs, which will aggravate the performance of your computer. If you are uploading Unlocker program, then do it only on the official website or from trusted sources. Be responsible about what you download to your computer and even more so what programs you install. Sometimes, after installation, you get not quite the new features that you expected, and you have to carry the computer for repair.

You delete them. In general, you are doing the usual things.

And I think that for all this time you have ever come across the fact that one of the archives, one of the folders is not deleted. A window pops up with some kind of error, or the system gives an answer in the form: the directory is currently occupied by the process.

To solve this problem Let's use 5 effective ways:

  • System check;
  • Viruses;
  • Folder settings;
  • Third party utilities.
  • How to delete a folder from a computer

    System reboot

    If you needed to delete a directory from your computer, but the operating system does not allow you to do this, the reason is most likely that the files in the folder are currently being used by some system process or software application.

    This often happens when you want to transfer a folder to a USB flash drive, but the transfer does not start because one of the files inside the folder is open or was closed with noise, glitches, etc.

    The example shows that the folder called "Custom Office Templates" cannot be destroyed because the operation cannot be completed because the document inside this folder is open in Word. In this case, just close the file and try again.

    Figure 1: Reason why the folder is not deleted

    However, it is not always so easy. Sometimes you see a message that one or more files are in use by one of the Windows programs. In this case, most do not know which program does not allow you to delete the folder.

    The example demonstrates that it is not possible to destroy the "Custom Office Templates" directory, because the system uses files from this directory. What files are used, and which specific applications use them, is unknown. Exit - restart the computer. - the easiest and most convenient option.

    The correct way to reboot is using the Start menu: Click Start, click the square next to the Shut Down button, and select Restart. This allows you to save all unsaved data at the time of the reboot.

    If you force a reboot by pressing the Reset button, then unsaved data will be lost, moreover, an abnormal shutdown can lead to problems the next time you start the system.


    Figure 2: System reboot

    Examination

    If instead of solving the problem with a simple reboot, you still want to find out what the problem is, check where the currently running applications are located - the directory you are deleting may contain one of them. This is especially true for those cases when applications start in startup mode, that is, they are activated regardless of user actions immediately after the system boots.

    Removing apps from startup

    For Windows 10:

    Do not overdo it with disabling applications. You may not feel it, but autoloading makes our lives easier. Do not remove important programs from startup!

    If for any reason you want to remove the program installed in the system not by regular uninstallation, but by destroying the folder in which the application is located, you will need to perform the following steps:

    Open the application directory (C - Programm Files - the name of the program). If you try to delete this directory, most likely the system will not allow it. The reason is that the application is running and, in the course of its work, blocks a number of files in the directory. The program at this moment hangs in the "Processes" section of the Task Manager (you already know how to open the Task Manager, see above).

    Close the application and remove the process from the task manager

    To do this, exit the application, press Alt + Ctrl + Delete and select “Task Manager” on the blue background (this is another way to open the task manager). In the manager, select the program from the list of running applications, click on the "End Process" button and confirm the completion in the dialog box that appears. On Windows 10, by right-clicking on the active program, click on End Task.

    Now the directory can be destroyed, since the system no longer locks its files.
    Thus, you can delete "non-deleted" folders in Windows system 7,8, 10 and hopefully in other versions.

    The sequence of actions described above will help you delete the folder of almost any application.

    Viruses

    Sometimes the directory cannot be destroyed for the reason that the system has become infected with malicious software - a virus. Often, a virus can infect a system not only through the Internet, but also through external media, for example, flash drives.
    If the directory is not removed from the flash drive, you should check the flash drive with an antivirus program. If, after scanning with an antivirus, the folder is still not deleted, this means that the antivirus program did not cope with the task, and the flash drive should be reformatted.

    Important! The formatting procedure leads to a complete cleaning of the flash drive: all directories and files on it will be destroyed.

    Performing formatting.

    Select the connected drive in the "Explorer" - the problematic flash drive and select the "Format" mode by right-clicking the mouse.


    Figure 5: Formatting a flash drive

    A menu will open with the following settings:

    Folder settings

    This method is suitable for network directories. If the administrator has combined several computers into a single network and created folders with public access, he, as a rule, sets certain access levels on these folders. To do this, you will have to do the following:

    If you mark all users who are associated with deletion, the user (or group of users) will not be able to delete the contents of the directory and the directory itself. In other cases, its access to the directory data will be full.

    External applications and utilities

    If you need to remove the directory with the files that are currently in use by the application, you can use the free simple Unlocker utility.
    Activate the program and select the directory you want to delete.

    We delete all active software processes with the "Kill Process" button. Now you can destroy both the folder and the application.

    Similarly, you can remove other applications, programs and directories from the system.

    This method is not elementary - in any case, you will need to know where the directory is located. On the other hand, as a rule, the installation of all applications and programs takes place in the Program Files system directory.
    If the directory is not deleted from the virtual desktop or from other places on the computer, you can easily delete it by following the described recommendations. software, and then destroy the directories themselves.

    Important!

    When receiving a command to delete a folder from the user, the operating system never issues errors and warnings if the contents of this folder are not currently in use. If the file is not open, it does not work in background(check through the task manager), but it still does not delete, this means that the directory contains virus-infected content. Be sure to scan your PC with an antivirus. Please note that very often infection occurs at the moment when you download information from the Internet. In other cases, the reason is simple negligence and inattentive reading of the dialog box messages, which, as a rule, clearly state the reason why it is impossible to delete the directory.

    If the computer reports that the file is open in another program

    Most often, the inability to delete a file in Windows is due to the fact that it is busy with some kind of system process. When this happens, the message "The action cannot be performed because this file is open in" appears. The name of the program».

    In this case, you need to close the program that uses the file and try to delete it again. If you see her window, just close it. If a program is running in the background and you don't know how to close it, launch the "Task Manager" (Ctrl + Alt + Del), find this program by name in the list, right-click on it and select "End Task".

    If you cannot find desired program in the "Task Manager", try a third-party utility that unlocks files. Suitable free app lockhunter. After installing it, right-click on the file and select What is locking this file?. When the LockHunter window appears, click on the Unlock It! button in it.

    Then try deleting the file again. If unsuccessful, restart your computer and try again. To completely remove from your computer, do not forget to empty the Trash.

    If your computer says you are denied access

    Sometimes you can't delete a file because your account doesn't have permission to do so. In such cases, Windows reports that access is denied. To solve this problem, you need to change the owner of the file. In the process, you may need a login and password from the PC administrator account.

    To change permissions, right-click on the file and go to "Properties" → "Security" → "Advanced". Next to the "Owner" item, click "Change", then "Advanced" and "Search". Select the current one from the list account and click OK.

    After that, you will most likely be able to delete the file in the usual way. If it doesn't work, try restarting your computer and try again.

    How to delete a file in macOS

    If the Mac says the file is in use

    To get started, manually close the applications in which you used this file and try erasing it again. They can interfere with uninstallation, as they do on Windows. If unsuccessful, restart your computer and try the uninstall again.

    If it doesn't work, log in safe mode. To do this, restart your Mac while holding the Shift key. Try moving the file to the trash and emptying it, then restart your computer in normal mode.

    If the file cannot be deleted for other reasons

    The file may not be deleted due to disk errors. Therefore, launch the "Disk Utility" in the Finder → "Programs" → "Utilities" section and check the disk on which the file is located in it with the "First Aid" service.

    Once verified, restart your Mac and try deleting the file.