This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Documentation / Mathematica / Built-in Functions / System Interface / File System /

DeleteDirectory

FilledSmallSquare DeleteDirectory["dir"] deletes the specified directory.

FilledSmallSquare DeleteDirectory["dir", DeleteContents -> True] deletes dir and all files and directories that it contains.

FilledSmallSquare DeleteDirectory["dir"] deletes the directory dir only if it contains no files.

FilledSmallSquare DeleteDirectory returns Null if it succeeds in deleting a directory, and $Failed if it fails.

FilledSmallSquare See Section 2.12.6.

FilledSmallSquare See also: CreateDirectory, DeleteFile.

FilledSmallSquare New in Version 2.