How to force delete a folder from a computer in Windows

Quite often, users of Windows-systems are faced with the eternal problem of deleting files and directories, and even those that, in theory, have nothing to do with system components. In such a situation, you have to look for some suitable solution. About how to delete an undeletable folder, and then try to figure it out. Below are some of the simplest methods for which you do not need to have special knowledge.

Why and what folders in Windows are not deleted?

So, before making any of the most suitable decisions, let's briefly dwell on why some directories are not deleted, and what components they may be. Here you can imagine several options. Usually, system directories are found to be unremovable, in which there are components responsible for the correct operation of Windows. True, you can get rid of some of these folders as unnecessary (when deleting, it may be indicated that the user must have administrator rights to perform actions, as indicated by the corresponding icon on the delete button).

Delete the renamed SoftwareDistribution.old folder

Sometimes, as is the case with a crowded SoftwareDistribution directory, renaming and subsequent deletion helps. Often folders can be blocked by viruses, but situations where the system reports that a file in a directory is occupied by another process are even more common. Thus, speaking of how to delete a folder forcibly in Windows 7 or in any other modification of the operating system, we will proceed from such initial conditions.

Simple directory removal steps

Initially, suppose that it is impossible to get rid of the selected directory due to possible errors in the operating system or when the files in the folder are occupied by other processes, but the user does not know which ones. In this case, it will not be enough to close all running applications that could theoretically use these files, but it is necessary to perform a complete reboot of the system, and then try to uninstall again. However, this approach is applicable only if the program that accesses the directory and its attached files is not registered in startup, because the application will restart after restart and the user will get the same problem. How to force delete a folder in this case? To do this, you will have to figure out exactly how the directory files are busy.

How to force delete a folder in Windows XP and above if it is busy with some process?

Suppose that the removal problem arose again, but in the section of applets starting with the system, the user did not find the required process.

Completion of the process in the "Task Manager"

In the simplest case, it will be enough to call the “Task Manager” and terminate the service, which uses the data of the deleted directory manually, removing the task by pressing the corresponding button or using the RMB menu. Most often, such situations are manifested during the work of messenger programs like Skype or torrent clients, which, when the main window is closed, just minimizes to tray and does not complete the work. Sometimes even exiting the application does not help, but its process still remains active. But having completed it in the "Task Manager", the directory of the running program can also be deleted.

Note: sometimes to delete folders that may be occupied by system processes or driver services, it may be advisable to start the system in safe mode, and then repeat the deletion.

Actions with directory attributes and files in them

Now suppose that the directory and files attached to it are not occupied by any system or user processes, but you still cannot get rid of them. How to force delete a folder in Windows 8 and in other modifications, because there is no explicit involvement of components? Very often, users lose sight of the moment that for the directories themselves and for the files present in them, an attribute can be set that allows read-only.

Removing Read Attribute from Folder

As already understood, in the "Explorer" you need to go to the folder properties through the RMB menu, remove the corresponding attribute, and then agree to perform this action for all nested objects. After that, removal will be possible.

How to force delete a folder in Windows 10 and below with changing permissions?

One of the most effective methods can be called changing access rights to undeletable objects, however, sometimes a change of ownership may also be required (for example, from TrustedInstaller to administrator). Let's see how to forcibly delete a folder using this technique.

Change rights to change the folder and its contents

Through the PCM menu, you need to go to the properties of the selected directory, then select the user or group, click the additional settings button, double-click the permission change button, and the list must delete and change the directory contents. After saving the options, in theory, you can get rid of the folder.

Directory Owner Change

If this does not help or if you cannot change the specified permissions, you should refer to the owner’s tab and change it to an administrator or a user who has similar rights.

Note: when you try to change the owner for system directories, some files (for example, in the Windows directory) may still be locked. But this applies only to system components, and when performing actions with user directories, such errors usually do not occur).

Removing folders through the command line or using a .bat file

Considering the problem of how to forcibly delete a folder of any category, on Windows operating systems, you can use the command line or PowerShell console, which must be started as administrator.

Delete a folder on the command line

As an executable command, the combination RMDIR / S / Q is prescribed, after which, after a space, the full path to the directory is entered with the drive on which it is located.

To simplify the actions, you can immediately enter the delete command in Notepad, then save the file in BAT format, and run it on behalf of the administrator for its execution, which, in fact, is the same as with the command line actions.

Removing directories in file managers

Now let's see how to forcibly delete a folder from a computer using third-party tools. One of the simplest options for performing such actions is to use all kinds of file managers that are not limited in rights.

Delete folders in FAR Manager

So, for example, Commander programs like Total Commander or FAR Manager, based on the notorious Norton Commander, previously actively used in DOS systems, look quite interesting in this regard.

Using the utility to unlock Unlocker

Finally, it can be assumed that the actions in file applications were unsuccessful. How to force delete a folder in this situation? There is a solution too! Apparently, many have heard of such a unique utility as Unlocker. Sometimes it can be found in some builds of Windows 7. If it is not in the system, you can install the program yourself. The steps here are very simple.

Unlocker directory removal

It is enough to select the “Unlocker” item through the RMB menu on the directory to be deleted, and then in the drop-down menu, set not unlock, but delete. It almost always helps.

What to do if none of the proposed methods has an effect?

Finally, suppose the most improbable - none of the methods described above gave an effect. This also happens, but mainly applies exclusively to certain categories of viruses. What to do in this case? If anyone does not know, absolutely about all objects (both files and folders) the information is recorded in the system registry.

Search registry keys for folders and files

Thus, first you need to find information about the object in the editor (regedit) by searching by its name (in the example above, the directory is conditionally named Virus), delete all the keys associated with it, after which you can get rid of the directory itself. If the folder still does not delete immediately after making the changes, you will first need to restart the system, and after restarting, try to delete again.

In principle, if only we are not talking about system objects or for some reason the user does not have enough access rights to change the contents of the registry, this technique always works! By the way, it is actively used precisely in those cases when there are problems with the manual removal of the same advertising viruses or uninstallable programs. However, in the end, it is for uninstalling applications or browser panels that you can be advised to use special uninstaller programs (for example, iObit Uninstaller). Such utilities can automatically clean leftovers, as well as delete undeletable files and folders that could remain if the program was deleted incorrectly by other means (for example, through the standard section of programs and system components).

Source: https://habr.com/ru/post/C40001/


All Articles