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 <direcoty_name> command in the window terminal.

Answers 1
  • 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
    
    0

    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