Icon RemoveDirectory

Unit: Internal

Available In: Server Applications

procedure RemoveDirectory(const Directory: String)

The RemoveDirectory procedure removes the directory specified in the input parameter. The specified directory path can contain intermediate directories, but those intermediate directories must exist and the procedure will only remove the final directory in the path. If the directory cannot be removed for any reason, an exception will be raised.

Information The specified directory path should be an absolute path. Relative paths are permitted, but they rely on the current working directory. The current working directory is a per-process setting and is not reliable in a multi-threaded setting like the web server.

Examples

if DirectoryExists('C:\temp\backup') then
   RemoveDirectory('C:\temp\backup');
Image