How to delete folders in sdcard of file explorer?

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}


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.

Tags:

Android