How to delete folders or directories from the CMD console in Windows

Windows-CMD

When using any computer with Windows operating system, the most common is to use the graphical interface. Through it, it is possible to carry out any action, taking into account that there are many programs and applications for this that give this possibility.

However, another way to manage Windows is to use the operating system command console, also known as a command prompt, Command Prompt or just CMD. This is not usually the usual way of doing it, but on certain occasions you may not have another option, and one of the most demanded commands in said terminal is usually to delete things, so we are going to show you how can you delete any directory or folder from CMD in Windows.

So you can delete a folder or directory using the CMD console in Windows

As we mentioned, on many occasions it is easier to directly delete the desired folder in question using the operating system's own file explorer. However, sometimes this is not possible or you prefer to do it using the CMD console, through which it is possible to force the deletion of the directory or folder in question.

To do this, you must first go to the directory that contains the folder to delete using the command cd ruta-directorio. Once you are in the directory before the folder to delete, something that you can easily see since the command bar shows it just before the cursor, You must execute the following command to delete the directory or folder you want within it:

RD /S <carpeta>

Delete directory or folder from CMD in Windows

Windows PowerShell
Related article:
So you can delete any file from CMD in Windows

In this case, unlike to delete a file, the concrete instructions of the command come from the operation Remove Directory (RD, in English delete directory), on which the / S attribute is executed so that the subfolders contained in said directory are also eliminated, because if it is not applied in the case of a subdirectory (another folder within it), Windows will not eliminate it.


Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.