Commands · Command

CommandWindows

rmdir / rd

rmdir directory [/s] [/q]

Removes a directory; rd is a shorthand alias for the same command. By default it only removes empty directories.

// FLAGS

/sremove the directory tree including all files and subdirectories
/qquiet mode — suppress the confirmation prompt when used with /s

// EXAMPLE

rmdir /s /q C:\Temp\old-build — deletes the folder and everything in it without prompting.

// GOTCHA

/s /q together deletes recursively with zero confirmation and no recycle bin — functionally the Windows equivalent of rm -rf, with the same risk.

// RELATED COMMANDS