hello,
I have this below .vbs script code that I use to delete two files from an FTP site. Sometimes one or both of the below files (LTRDOWN01 and CABCALLS.txt) doesn't exist, so that when the vbs code is executed an error occurs. How can I modify the code so that each Remove statement is executed *only* if the file exists?
thanks in advance,
david
---------------------------
' VBS Script Generated by CuteFTP (TM) macro recorder.
' Generated, then edited: 02/07/07 by dgr.
' Create TEConnection object
Set MySite = CreateObject("CuteFTPPro.TEConnection")
' Initialize remote server host name, protocol, port, etc.
MySite.Host = "192.168.1.1"
MySite.Protocol = "FTP"
MySite.Port = 21
MySite.Retries = 34
MySite.Delay = 7
MySite.MaxConnections = 4
MySite.TransferType = "ASCII"
MySite.DataChannel = "DEFAULT"
MySite.AutoRename = "OFF"
' WARNING!!! SENSITIVE DATA: user name and password.
MySite.Login = "****"
MySite.Password = "***"
MySite.SocksInfo = ""
MySite.ProxyInfo = ""
' Connect to remote server
MySite.Connect
MySite.RemoteRemove "/u/sting/tapefiles/LTRDOWN01"
MySite.RemoteRemove "/u/sting/tapefiles/CABCALLS.txt"
MySite.Disconnect
I have this below .vbs script code that I use to delete two files from an FTP site. Sometimes one or both of the below files (LTRDOWN01 and CABCALLS.txt) doesn't exist, so that when the vbs code is executed an error occurs. How can I modify the code so that each Remove statement is executed *only* if the file exists?
thanks in advance,
david
---------------------------
' VBS Script Generated by CuteFTP (TM) macro recorder.
' Generated, then edited: 02/07/07 by dgr.
' Create TEConnection object
Set MySite = CreateObject("CuteFTPPro.TEConnection")
' Initialize remote server host name, protocol, port, etc.
MySite.Host = "192.168.1.1"
MySite.Protocol = "FTP"
MySite.Port = 21
MySite.Retries = 34
MySite.Delay = 7
MySite.MaxConnections = 4
MySite.TransferType = "ASCII"
MySite.DataChannel = "DEFAULT"
MySite.AutoRename = "OFF"
' WARNING!!! SENSITIVE DATA: user name and password.
MySite.Login = "****"
MySite.Password = "***"
MySite.SocksInfo = ""
MySite.ProxyInfo = ""
' Connect to remote server
MySite.Connect
MySite.RemoteRemove "/u/sting/tapefiles/LTRDOWN01"
MySite.RemoteRemove "/u/sting/tapefiles/CABCALLS.txt"
MySite.Disconnect