CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • How to delete a folder and all its content through dos prompt with spaces

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    31
  • Date Created
    Friday, October 8, 2010
  • Last Updated
    Sunday, September 16, 2012
  • This Article Has been Viewed
    1601 times
  • Short Desc
    Using dos prompt otherwise known as dos window, command prompt to delete a folder and all its sub folder and content with and without spaces (Updated 9-16-2012).
  • Details
    Using the Dos Prompt window to delete folders that have spaces or no spaces, that are massive in size can be done rather easily with some simple triggers. Deleting a couple hundred gigabytes will only take a minute or so compared to doing a normal delete using windows explorer which will take a very long time to delete a few hundred gigabytes.
  • Recreate Issue
    If you have a drive that has a folder that is really huge in size and you want to delete it without having to do a format that will also delete all the other data that is currently on the drive.
  • Resolve Issue
    Using the following method will save you loads of time, and will clean up needed space fast and without much wait.

    first thing, you will need to get into the folder.
    Now, if you are wanting to delete files from another drive, then please check out this article on Changing Directories in a DOS Prompt«.

    Once you get into the drive or folder that you want to be in, type out the following to delete the folder and all its content.

    WARNING!!!
    This information will perform the task without any prompts, which means that all the data will be lost, so make sure that you remove any data that you wish to keep before performing this operation.

     
    d:\>rmdir /s /q folder_to_delete
    with spaces
    d:\>rmdir /s /q "folder with spaces"


    Once the folder is completely deleted, the prompt will jump back to the drive letter.
    As you can see in the 2nd trigger, we have provided " " Quotes around our spaced out names.

    Explaination of triggers
    RMDIR = Removes a directory
    /S Removes all directories and files in the specified directory
    in addition to the directory itself. Used to remove a directory
    tree.
    /Q Quiet mode, do not ask if ok to remove a directory tree with /S