FTPDELDIR        Delete a directory on a remote site

Top  Previous  Next

Syntax:

FTPDELDIR

[ dir name ]

Arguments:

[ dir name ]

Variable or string defining the directory name to delete.

Options:

/delfiles

Delete all files from the FTP site in [ dir name ].

 

/incldirs

Delete all subfolders of [ dir name ] on FTP site.

 

 

When connected to a HTTP/HTTPS site, this command will only work with a DAV enabled web server. For further details on DAV enabled web server, see http://www.webdav.org/specs/rfc2518.html.  When connected to a HTTP/HTTPS site, the FTPDELDIR command will delete non-empty directories.

 

This script command deletes a directory on a remote site. When connected to an FTP site you can only delete empty folders.  When connected to a HTTP/HTTPS site you can also delete non-empty folders.

 

This is an example of the FTPDELDIR command:

 

FTPDELDIR "olddirectory"

 

Consider the following example where all files and sub-folders found in olddirectory are deleted on the remote site.

 

FTPDELDIR "olddirectory" /delfiles /incldirs

 

Note: If the /delfiles option were omitted in the preceding example, the FTPDELDIR command would report an error if any of the sub-folders contained files because FTPDELDIR only deletes empty folders on FTP sites.

 

Wildcard characters are not permitted with the FTPDELDIR command.

 

To delete a local folder, use the DELDIR script command.

 

After any remote files have been deleted, the %ftpdeletefiles internal script variable is automatically populated with the filenames of all such files.

 

Related command(s): FTPCD, FTPDELETE, FTPMAKEDIR, FTPRENAME, Using the %deletefiles and %ftpdeletefiles Variables