I have a vbscript (see below) where I am trying to use the "mput" to ftp multiple files to an AS/400. The "mput" does not seem to work, at least I am not getting records into the receiving file. If I use the "put" it works and one file is being transferred. Any ideas? Thank you.
PHP Code:
strLocalFolderName = "e:\ftpdata\fromcustomer"
strFTPServerName = "vgsys400.mycompany.com"
strLoginID = "userid"
strPassword = "password"
strFTPServerFolder = "vgiprdhrp"
'Set File name
strFilePut = "*.txt"
strFilePut1 = "f5508607i"
'Generate FTP command
strFTPScriptFileName = strLocalFolderName & "Customer Inbound FTP Files to AS400"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If (objFSO.FileExists(strFTPScriptFileName)) Then
objFSO.DeleteFile (strFTPScriptFileName)
End If
Set objMyFile = objFSO.CreateTextFile(strFTPScriptFileName, True)
objMyFile.WriteLine ("ftp -s: " & strFTPServerName)
objMyFile.WriteLine ("open " & strFTPServerName)
objMyFile.WriteLine (strLoginID)
objMyFile.WriteLine (strPassword)
objMyFile.WriteLine ("cd " & strFTPServerFolder)
objMyFile.WriteLine ("lcd " & strLocalFolderName)
objMyFile.WriteLine ("prompt off")
objMyFile.WriteLine ("mput " & strFilePut & " " & strFilePut1objMyFile.WriteLine ("disconnect")
objMyFile.WriteLine ("bye")
objMyFile.Close
'Run ftp script
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run ("ftp -s:" & chr(34) & strFTPScriptFileName & chr(34))



Comment