KB Issue
Using the DOS prompt command to delete a folder and all its subfolders and content, with and without spaces (Updated 9-16-2012).
Issue 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 of hundred gigabytes will only take a minute or so, compared to a normal delete in Windows Explorer, which can take a very long time.
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 clean up the needed space fast, with minimal waiting.
First, you will need to open the folder.
If you want to go into another drive.
C:\Users\YourUser>D:
Copy
Search Site
Search Google

Will place you in that drive.
D:\>
Copy
Search Site
Search Google

To go into a folder and then into a subfolder.
D:\>cd FolderOne
Copy
Search Site
Search Google

D:\FolderOne>
Copy
Search Site
Search Google

If you need to go into a folder with spaces.
D:\FolderOne>cd "My Folder Here"
Copy
Search Site
Search Google

D:\FolderOne\My Folder Here>
Copy
Search Site
Search Google

To read more about the prompts. Changing Directories in a DOS Prompt«.
Once you're in the drive or folder you want to be in, type the following to delete the folder and all its contents.
WARNING!!!
This information will perform the task without prompts, which means all data will be lost. Make sure you remove any data you wish to keep before performing this operation.

d:\>rmdir /s /q folder to delete
Copy
Search Site
Search Google

with spaces

d:\>rmdir /s /q "folder with spaces"
Copy
Search Site
Search Google


Once the folder is completely deleted, the prompt will jump back to the drive letter.
[Explanation of triggers]

RMDIR
Copy
Search Site
Search Google
= Removes a directory
/S
Copy
Search Site
Search Google
Removes all directories and files in the specified directory, in addition to the directory itself.
/Q
Copy
Search Site
Search Google
Quiet mode, do not ask if ok to remove a directory tree
"folder with spaces"
Copy
Search Site
Search Google
- Must wrap all folder names with double quotes.