There are many simple methods to delete a folder in Windows, and using command prompt for this process might be an unconventional way.
You can simply go to windows explorer and hit the delete button for deleting a folder. However, this method can sometimes take an eternity to remove a large number of contents within a folder.
In that case, the command prompt can come in super handy. Plus, it can also help you tackle restrictions while deleting some restricted files or folders (unwanted system and junk files).
However, keep in mind that the command to delete a file or folder is final. The deleted items won’t go to the recycle bin, and it is not possible to recover data after utilizing these commands.
So, make sure you only erase those files or folder which you genuinely want to remove from your computer.
Also read: How to Delete a File Using Command Prompt
How to delete a folder using CMD
- Click the Start button.
- In the Search box, type ‘cmd’.
- Right-click on Command Prompt, and then click Run as administrator.
4. Type the following command.
rd /s /q "folder path"
Replace “folder path” with the actual path of the folder that you want to delete.
5. Hit Enter after you put in the command and the folder should be deleted by now.
Example – rd /s /q “d:\jun” – here jun is the folder that I want to delete.
Now you can delete files and folders on your computer using Command prompt. However, keep in mind that files or folders deleted using the command line are not recoverable. If you have any doubts, then make a backup first.