Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(AutoIt) Delete Files Matching PatternThe DeleteMatching method deletes all files in the current remote directory matching a wildcarded filename.
; This example requires the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. $oFtp = ObjCreate("Chilkat.Ftp2") $oFtp.Hostname = "www.chilkatsoft.com" $oFtp.Username = "MyLogin" $oFtp.Password = "MyPassword" ; Connect and login to the FTP server. Local $bSuccess = $oFtp.Connect() If ($bSuccess <> True) Then ConsoleWrite($oFtp.LastErrorText & @CRLF) Exit EndIf ; Change to the remote directory where the files to be deleted are located. ; for the FTP account. $bSuccess = $oFtp.ChangeRemoteDir("junk") If ($bSuccess <> True) Then ConsoleWrite($oFtp.LastErrorText & @CRLF) Exit EndIf ; Delete all files with filenames matching "ftp_*.asp" Local $iNumDeleted = $oFtp.DeleteMatching("ftp_*.asp") If ($iNumDeleted < 0) Then ConsoleWrite($oFtp.LastErrorText & @CRLF) Exit EndIf $bSuccess = $oFtp.Disconnect() ConsoleWrite($iNumDeleted & " Files Deleted!" & @CRLF) |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.