How to delete a directory using the command in window ?

Created at 22-Feb-2022 , By samar

How to delete a directory using the command in window ?

We will use programming in this lesson to attempt to solve the "How to delete a directory using the command in window ?".

To delete the directory with all nested files and subdirectories you have to use the rmdir /s command in the window terminal.
  • Delete directory with all nested files and subdirectory in window using cmd

    rmdir /s <directory-name>
    <!-- Code Example: -->
    E:\laragon\www>rmdir /s samar
    samar, Are you sure (Y/N)? Y
    

    To remove a directory including all nested files and subdirectories, just use the /s flag. Here we have a directory samar inside www directory. To remove the samar directory with all nested files and subdirectories you have to go to the inside of www and hit the rmdir /s samar command.

Back to code snippet queries related cmd

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

Don't forget to share this article! Help us spread the word by clicking the share button below.

We appreciate your support and are committed to providing you valuable and informative content.

We are thankful for your never ending support.