The folder is not deleted from the flash drive: what to do?

Probably, it’s not necessary to say that many of us have faced a situation where when working with removable storage devices, the selected folder from the USB flash drive is not deleted. What to do in this case? Untrained users, no matter how they try, do not succeed, as a result of which they are inclined to make a decision on formatting the medium.

Yes, indeed, this is the most radical way to delete the entire contents of a flash drive. However, in some cases, when it is not necessary to delete everything, but only some selected directories, and also if the device is installed protected from any actions, this method is not applicable. However, let's look at what can be done and how to get out of this situation.

Why the folder from the flash drive is not deleted (writes: “The disk is write-protected” or “The folder is not empty”, etc.)

To begin with, it is worth paying attention to clarifying the causes of this phenomenon.

Disk is write protected

And the first thing you need to look at the content of the message that is displayed when you try to delete the selected directory:

  • If the folder is not deleted from the USB flash drive, and the write protection is mentioned in the notification, this indicates that protection (mechanical, cryptographic, etc.) is enabled on the device itself.
  • Sometimes there are messages that there are some files in the selected directory, but they are protected from deletion.
  • Sometimes nested objects may be occupied by some processes currently occurring in the system. Some categories of viruses blocking access to the directories themselves and to their contents can be called a very common cause of this phenomenon. In this case, a notification is also issued that the folder is not empty, the folder from the USB flash drive is not deleted, and it is impossible to perform any actions with the attached files.

So what actions can be taken to perform the necessary operations to delete directories from removable media or their contents (partially or completely)? There are several solutions that can be considered, which will be examined in more detail and in relation to the most common situations, which do not include problems associated with damage to the removable drives themselves.

Folder from flash drive is not deleted: what to do with protection?

So, for a start, a few words about protection. First of all, pay attention to the presence of a special switch on the flash drive itself. It can be under the lid or directly on the case. Most often, next to it there is a notation like Write-protect or Lock. Just move the slider to the off position and try deleting the desired directory again.

However, it also happens that after that the folder on the USB flash drive is not deleted. What to do in such a situation? Here you will have to check the attributes of the undeletable directory itself or files attached to it.

Read Only Attribute

Using the RMB menu on the selected object, go to the properties and make sure that the checkbox is not selected on the read-only attribute setting item. If there is one, remove it and then repeat the removal. But protection can be installed not only in this form. Sometimes it is activated in the operating system settings. We will dwell on this separately, but for now we will continue consideration of the simplest solutions.

Simple actions with unremovable directories

Then again, we assume that some folder from the flash drive is not deleted. How to delete the selected directory?

Rename the problem folder

Here you can use one of the classical methods, which consists in first renaming the selected directory (if possible) or moving to another location on the drive by cutting, and then try to delete.

In some cases, you can do even easier by first deleting all its contents from the folder, and then itself. If for some reason this does not work, then at least it will be possible to identify an undeletable file, and then start to unlock it already.

Removing flash drive protection through group policies

Now we will dwell in more detail on the security settings installed directly in the settings of Windows operating systems. Two sections are provided for this: group policies and the system registry. By and large, in some settings they duplicate each other, but the priority of registry settings is higher.

To begin with, if the folder is not deleted from the USB flash drive, consider the actions in the Group Policy Editor. It is called through the "Run" console with the gpedit.msc command.

Unprotecting a flash drive in Group Policy

In its parameters, you need to find the access section for removable storage devices, enter the options for the prohibition of writing to removable drives and turn it off, then save the changes.

Deactivating removable media protection through the registry

For cases when some folder from a flash drive is not deleted due to blocking access to the device itself, it is more advisable to use the system registry (regedit).

Uninstalling a flash drive in the registry

In the editor, through the HKLM branch and the SYSTEM, CurrentControlSet and Control sections, go to the StorageDevicePolicies directory. A key with the name WriteProtect will be shown on the right, for which you should set the value to "0". If the desired section is missing, you need to create it, then create the DWORD parameter in the section itself, and then assign it the above name and value.

Setting the necessary access rights and permissions to directories

Finally, let's look at situations where a folder from a flash drive is not deleted due to the lack of access rights to it or some special permissions. To set all the necessary rights, you need to enter the properties of an undeletable directory and set the full set of rights for all users and groups on the sharing settings tab.

Setting folder permissions

Note: the security tab in the properties section provided for directories stored on the hard disk or in the logical partition may not be present.

Removing Content Using the Unlocker Utility

Why the folder is not deleted from the flash drive, and what can be done to correct the situation, in general terms is a little clear. Finally, a few words about the use of the universal utility Unlocker. With its help, you can either restore access to the files and get rid of them individually, or apply similar measures to the entire directory.

Unlocking a folder with Unlocker

Select the desired directory and through the PCM menu go to the Unlocker program item. From the list of actions, set the deletion and confirm the operation.

Using command line tools

Finally, any folder from a USB flash drive can be deleted via the command line. In this case, you first need to find out the letter of the disk using the diskpart and list disk commands , then go to the removable device using the cd: \ command, and then delete the directory by executing the commands “rmdir \ Directory Name” or “RD \\. \ Disk Letter : \ Path \ Directory Name. "

What to do with viruses?

In conclusion, it remains to consider only computer security issues regarding the blocking by viruses of access to information stored on removable devices, or to flash drives themselves.

In the simplest case, it is recommended to check using portable scanners like KVRT or Dr. Web CureIt !, and if it is impossible to neutralize threats with their help, use disk utilities with the general name Rescue Disk, which allow you to load your own environment even before the operating system starts and perform an in-depth check of everything that is available, including removable drives, and online memory.

Very often on flash drives you can also find autorun.inf files, which can be either infected objects or components of virus programs. Removing them will not be difficult even in manual mode via the command line using the command "del \ File Name" (in our case del \ autorun.inf) after entering the root of the medium.

A few words in the end

Above were considered only the most common situations and methods for their correction. In fact, there can be many more. However, if none of the above methods work, the media will have to be formatted. To begin with, it will be enough to clean the table of contents of the disk (quick format). If this does not take effect, you will have to do full formatting, for which the HDD Low Level Format Tool is best suited (and not the operating system tools, which may not always work).


All Articles