Link to home
Start Free TrialLog in
Avatar of E=mc2
E=mc2Flag for Canada

asked on

CuteFTP script to overwrite files in the destination folder

I would like to modify this CuteFTP script so that it automatically overwrites the files in the Destination path...

Currently when I run the VBS script it prompts me if I should overwrite, and I always have to say Yes.... I want to bypass that..

[code][/' VBS Script Generated by CuteFTP (TM) macro recorder.
' Generated at: 10/24/2018 10:10:10 AM.

' Create TEConnection object
Set MySite = CreateObject("CuteFTPPro.TEConnection")

' Initialize remote server host name, protocol, port, etc.
MySite.Host = "host.host.com"
MySite.Protocol = "FTP"
MySite.Port = 21
MySite.Retries = 30
MySite.Delay = 30
MySite.MaxConnections = 4
MySite.TransferType = "AUTO"
MySite.DataChannel = "DEFAULT"
MySite.AutoRename = "OFF"
' WARNING!!! SENSITIVE DATA: user name and password.
MySite.Login = "login1234"
MySite.Password = "password1234"
MySite.SocksInfo = ""
MySite.ProxyInfo = ""
' Connect to remote server
MySite.Connect
MySite.DownloadAsync "/out", "\\srv\files\Inbound\FTPInbound"code]
Avatar of Bill Prew
Bill Prew

Try adding:

MySite.FolderOverwriteMethod = "OVERWRITE"

Open in new window


»bp
Avatar of E=mc2

ASKER

Thanks Bill, however this is not working.
Avatar of E=mc2

ASKER

What I find that works, is the Synchronize method..

MySite.Synchronize "/remotefolder", "C:\LocalInbox\", 1, 1
Sorry, that should have been:

MySite.FileOverwriteMethod = "OVERWRITE"

Open in new window


»bp
Avatar of E=mc2

ASKER

Thanks Bill, however I tried that and it's still asking me if I want to overwrite files.. so I have to select it manually.
Seems like a bug, you might want to contact the vendor.


»bp
Avatar of E=mc2

ASKER

Thanks ...
ASKER CERTIFIED SOLUTION
Avatar of E=mc2
E=mc2
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial