Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete folders in sdcard of file explorer?

Tags:

android

I created several folders in the sdcard (Eclipse) by running an Android application in the emulator. Now I want to delete the folders which I have created on the sdcard.

I am able to delete files in the folders but I could not delete the folders in the sdcard.

How can I do this? Is there a way to delete folders?

like image 708
kehnar Avatar asked Sep 24 '11 08:09

kehnar


People also ask

Can you delete folders on SD card?

Delete folders or files on a microSD card: Note: On older devices you'll need to first select All Files and then select the SD Card option. Note: To delete files or folders, long press on the item you wish to remove, and select the Delete option in the top right of the screen.

Why can't I delete folders from my SD card?

▶ The file system of SD card partition is corrupted. If so, your SD card might be protected by adding read-only attributes to all files. Thus, you are not allowed to delete files.

How do you delete folders in File Explorer?

Tap or click to open File Explorer. Select the library where you want to remove a folder. Tap or click the Library Tools tab, and then tap or click Manage library. In the dialog box that appears, select the folder you want to remove, tap or click Remove, and then tap or click OK.


2 Answers

Using adb command you can delete folders.

click Run - > CMD-> type adb shell --> cd sdcard -> rmdir {dirname}

Note : Make sure your dir should be empty.

For non-empty directory use.

click Run - > CMD-> type adb shell --> cd sdcard -> rm -r {dirname}

like image 161
Brijesh Thakur Avatar answered Sep 18 '22 07:09

Brijesh Thakur


Well, answer from Brijesh Thakur is really helpful.

I just tried this and it worked fine for me to some extent. I would like to mention that if your directory contains any files then the rmdir command will not work. You will have to use rm -r command for that.

To make it more easy for beginners I am explaining the process as follows.

  1. First you need to locate your adb folder, mine was at D:\Android SDK\platform-tools>

  2. Now execute adb shell in a command prompt as:

    D:\Android SDK\platform-tools>adb shell 
  3. A hash (#) symbol or dollar sign ($) will appear, then enter the following command:

    # cd sdcard 
  4. Now you are in the sdcard of the device. If your folder is a sub folder then further locate its parent folder using the cd command. Finally, use the rm -r command to remove the folder recursively as follows. This will delete all files and directories in the folder.

    # rm -r FolderName 

Please note that if you want to remove a single file you can use the rm command only and then the file name (with extension probably). And you can also use rmdir command if the directory you trying to delete is empty.

like image 21
Rizwan Sohaib Avatar answered Sep 20 '22 07:09

Rizwan Sohaib