Home > Language Reference > File Functions > DelTree

DelTree

The DelTree function deletes all the files and subfolders below the specified folder.

Usage

Used to remove a folder.

Syntax

ret=DelTree(<foldername>)

Parameters

<foldername>, string, name of the folder to be deleted.

Return value

ret, optional numeric return value. If the function has successfully deleted the folder, the return value is 0. If the function fails, the return value is a nonzero value (see File Functions Error Codes).

Remarks

Use RmDir function to delete the folder name itself after having deleted its files and subfolders using DelTree.

See also

RmDir 
ExistDir

Examples

DelTree("c:\bmp")
RmDir("c:\bmp")

DelTree(direct$)
RmDir(direct$)