Previous Topic: DeleteFile or DelFile - Delete a FileNext Topic: ExistDir or ExistDirectory - Check if a Directory Exists


DeleteTree or DelTree - Remove a Directory Tree

Valid on NetWare, Symbian OS, UNIX, Windows and Windows CE

The DeleteTree or DelTree function removes the specified directory tree including all of its subdirectories, even if they are not empty.

Note: The specified directory must not be write-protected.

This file content function has the format:

DeleteTree(pathname as String) as Boolean
DelTree(pathname as String) as Boolean
pathname

Specifies the path of the tree that is to be deleted.

On successful completion, the function returns TRUE; otherwise, it returns FALSE.

Example: DeleteTree function

Rem
Rem By deleting the directory bak this forces a full collect next time 
Rem the Unicenter Asset Management agent is executed.
Rem 
DeleteTree(ComputerPath+"bak")
Rem ComputerPath is a Unicenter Asset Management constant