Jump to content


Photo

Delete file


  • Please log in to reply
2 replies to this topic

#1 MisterG

MisterG
  • Members
  • 2 posts

Posted 29 August 2006 - 09:41 AM

Hi,
Thanks for this great library !

I'm wondering how to delete a file in VBScript. The only example I found in the Help file is for C++

I looked into the Shared.vbs file given with the samples but no information about how deleting a file.

Could someone help me ?

Thank you.

#2 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 29 August 2006 - 10:53 PM

Try something like that:
Dim obj
Set obj = CreateObject("sfFTPLib.FTPConnectionSTA")

Dim result

' Settings
obj.Host = "smartftp.com"
obj.Username = "anonymous"
obj.Password = "test@test.com"
obj.Port = 21
obj.Protocol = 0 ' ftpProtocolNormal
obj.Passive = 1
obj.MLST = 1
' Enable logging
obj.LogFile = "Connect.log"

result = obj.Connect()
result = obj.ChangeDirectory("/blbalba")
result = obj.DeleteFile("test.zip")


#3 MisterG

MisterG
  • Members
  • 2 posts

Posted 30 August 2006 - 07:00 AM

Thank you !




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users