I have a FTP script and after the FTP I need to move the file to a backup folder. Not sure how to do this:
Option Explicit
Dim strFTPScriptFileName, colFiles, objFile, objFSO, objMyFile, objShell, objFolder, strFilePut
Dim strLocalFolderName, strFTPServerName, strLoginID
Dim strPassword, strFTPServerFolder
'Set FTP options
strLocalFolderName = "e:\ftpdata\fromcustomer"
strFTPServerName = "ftp.customer.com"
strLoginID = "userid"
strPassword = "password"
strFTPServerFolder = "from_customer"
'Set File name
strFilePut = "*.asc"
'Generate FTP command
strFTPScriptFileName = strLocalFolderName & "\Travelers_Inbound_Get_FTP_Files"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If (objFSO.FileExists(strFTPScriptFileName)) Then
objFSO.DeleteFile (strFTPScriptFileName)
End If
Set objMyFile = objFSO.CreateTextFile(strFTPScriptFileName, True)
objMyFile.WriteLine ("open " & strFTPServerName)
objMyFile.WriteLine (strLoginID)
objMyFile.WriteLine (strPassword)
objMyFile.WriteLine ("cd " & strFTPServerFolder)
objMyFile.WriteLine ("bin")
objMyFile.WriteLine ("lcd " & strLocalFolderName)
objMyFile.WriteLine ("prompt off")
objMyFile.WriteLine ("get " & strFilePut)
*** Here I need to move the file I just picked up to folder:
strFTPServerFolder + /Backup ***
objMyFile.WriteLine ("disconnect")
objMyFile.WriteLine ("bye")
objMyFile.Close
Option Explicit
Dim strFTPScriptFileName, colFiles, objFile, objFSO, objMyFile, objShell, objFolder, strFilePut
Dim strLocalFolderName, strFTPServerName, strLoginID
Dim strPassword, strFTPServerFolder
'Set FTP options
strLocalFolderName = "e:\ftpdata\fromcustomer"
strFTPServerName = "ftp.customer.com"
strLoginID = "userid"
strPassword = "password"
strFTPServerFolder = "from_customer"
'Set File name
strFilePut = "*.asc"
'Generate FTP command
strFTPScriptFileName = strLocalFolderName & "\Travelers_Inbound_Get_FTP_Files"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If (objFSO.FileExists(strFTPScriptFileName)) Then
objFSO.DeleteFile (strFTPScriptFileName)
End If
Set objMyFile = objFSO.CreateTextFile(strFTPScriptFileName, True)
objMyFile.WriteLine ("open " & strFTPServerName)
objMyFile.WriteLine (strLoginID)
objMyFile.WriteLine (strPassword)
objMyFile.WriteLine ("cd " & strFTPServerFolder)
objMyFile.WriteLine ("bin")
objMyFile.WriteLine ("lcd " & strLocalFolderName)
objMyFile.WriteLine ("prompt off")
objMyFile.WriteLine ("get " & strFilePut)
*** Here I need to move the file I just picked up to folder:
strFTPServerFolder + /Backup ***
objMyFile.WriteLine ("disconnect")
objMyFile.WriteLine ("bye")
objMyFile.Close