Deleting a local file or folder

Description

Use the LocalRemove method to delete a local file or folder. Use the absolute path name for the item you want to delete.

 

Syntax

Object.LocalRemove(BSTR bstrName)

 

Parameters

BstrName

This contains the items full absolute path.

 
Example

Set MySite = CreateObject("CuteFTPPro.TEConnection")

‘Initialize all necessary fields for MySite : host name, user, password, etc.

MySite.LocalRemove "c:\temp\file.txt"

 
Notes
You can also you wild cards to replace the string value of bstrName. These wild card masks include "*", "?", and ‘\n" (new line symbol, also known as Chr(10) in VB)
 
Example 2

Set MySite = CreateObject("CuteFTPPro.TEConnection")

‘Initialize all necessary fields for MySite : host name, user, password, etc.

MySite.LocalFolder = "c:\temp"

MySite.LocalRemove("file.ext") ‘removes if exact match

MySite.LocalRemove("*.obj") ‘wild card match with a specific extension

MySite.LocalRemove("*.aaa" & Chr(10) & "*.bbb" & Chr(10) & "t*") ‘various wildcard filters