DelTree

System function.

The DelTree function deletes all the files and sub-directories below the specified directory.

Syntax

DelTree(<directory_name>)
or
ret=DelTree(<directory_name>)

Parameters

<directory_name>, string, name of the directory under which all files and sub-directories have to be deleted.

Return value

Ret, numeric return code. When the deletion is successful, the function returns 0, otherwise use this return code for Error Handling.

Remarks

Use RmDir function to delete the directory name itself after having deleted its files and sub-directories using DelTree.

The function works as the old DelTree Dos function under Windows 98, so note that if the specified directory does not exist, no error is reported.

See also

RmDir

Examples

 

DelTree("c:\bmp")

RmDir("c:\bmp")

 

DelTree(direct$)
RmDir(direct$)