How to delete a folder via command prompt


Do you want to delete a folder right from the command prompt instead of deleting it manually? This is really easy and will help you to manage your PC more effectively.

Remove folder in command prompt

Command Prompt

There are two commands that you can use to delete a folder via command prompt.

  • rd
  • rmdir

Both commands are the same, but rd is shorter. I prefer rmdir because it is easier to remember and is closer to the Linux equivalent “rm” (that’s how you remove something in linux).

Tip: If you do not specify a path for the rmdir command you will have to CD to the correct directory. E.g. CD C:\delete\

Delete Folder + Subfolders And Files

If you want to delete all folders and files in a directory, you can use the option /s. The option /q will make sure that you will not be asked to confirm a deletion.

  • rmdir /s C:/path/to/folder

Examples

Delete folder from command prompt

1. The first line rd C:\delete\thisfolder was successful, we did not get any error message.

2. If you try to use the option -s (/s is correct) after CD’ing to the folder C:\delete will still remove the folder “thisfolder”, but will give you the error message The system cannot find the file specified.

3. rmdir /s thisfolder after CD’ing to the folder C:\delete will ask for your confirmation and will then delete the folder depending on your answer.


Or you might like these sexy wallpaper, tweaks and themes:

Written by oliversk Wednesday, November 3rd, 2010

Was it helpful? Please bookmark it and spread the word

delicious   facebook   google   twitter  

You love Windows, Gaming and everything digital? Great, we too! We have thousands of great Windows 7 themes, registry tweaks, tutorials, so please use our search box if you look for anything specific. If you have some awesome desktop themes, tips or want to write for us, then drop us a mail: win7themes at googlemail.com

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>