| |
snufse
Posts: 29
Score: 0
Joined: 9/5/2007
Status: offline
|
I am doing an FTP and when completed I need to move files to an "archive" folder. The file may already exists in the archive folder and if so I need to replace it. Below is the code I have. When the file already exists in the archive folder It gives me an error "File already exists". I was hoping below code would take care of this. Can anyone help? Thank you. For Each objFile In fileColl If objRegExp.Test(objFile.Name) Then strDest = folderName & "archive\" & newFile If filesys.fileExists(strDest) Then filesys.DeleteFile strDest filesys.MoveFile objFile, strDest If Err.Number <> 0 Then objEmail.Subject = "Travelers - ftp error in procedure: Travelers_Inbound_Archive_Encrypted_FTP_Files.vbs" objEmail.Textbody = "File: " & objfile & " in Folder: " & foldername & " Process: Archive outbound FTP file(s) failed: " & Err.Number & ") - " & Err.Description objEmail.Send Err.Clear End If End If Next
|
|