How to delete a directory using the command in window ?

Updated 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