How to Delete Folder from Command Prompt in Windows 7

In this tutorial you will learn how to permanently delete folders using basic commands. This can be helpful in such cases when you are not able to delete a folder or directory normally.
In this tutorial, we will show you how to delete a folder from command prompt. It must be noted that if you delete a directory using this method, the directory will be permanently deleted and not sent to the recycling bin. From the folder itself to all the contents that it contains, everything will be permanently deleted. It is always recommended to keep a backup first.

Step 1 – Opening up the run command

To get started on how to delete folder from command prompt, first of all, press the “windows + R” key to open up the Run command. With that done, type in “cmd” and hit enter to open up the command prompt.

using the run command to open up command prompts

Step 2 – Opening up the directory

Once the “Command prompt” window opens up, access the partition in which the folder is present. For example, here we will type in “f:” and press “enter”. Once done, use the “dir” command to view all the directories in that partition.
Here you can see that we have two directories, Test and Test1. Let’s delete both of them using different methods for each.

using the dir command

Step 3 – Using the rd command

In command line, delete folder commands can be used in different ways. First of all, type in rd /s /q followed by the name of the directory in quotes, which in this case is test.

deleting a folder

Step 4 – Using the alternate way

Now let’s type in “dir” and hit enter. There, the first directory, named test, has been removed.
You can also delete a folder without accessing the partition it is located in. For that, let’s go back to the c drive first.
Now let’s type in
rd /s /q, inverted commas, f:\,followed by the name of the directory which in this case is test1. And that is how the command line delete folder function works

deleting using an alternate way

Step 5 – Folders deleted

With that done, let’s use the “dir” command to see if the directory was deleted or not.
And there you have it. Both of the directories have been permanently deleted.

checking if folders have been deleted