The WinSCP command line in VB Script pulls one record at a time
Hello there,
I have a problem utilizing a PutFiles command in my script. It picks up only one file at a time instead of taking all files in the directory as specified. However, GetFiles pulls all files. Please, please, please advise A.S.A.P. Following is the part of the script I have a problem with:
Do while true
if ie.document.all("continue").Value = "no" then
ie.Quit
exit Do
end if
If DateDiff("s", lastRunTime, curDateTime) > 60 then
If Minute(curDateTime) = 29 or Minute(curDateTime) = 59 Then
' ----- Upload files
Set transferResult = session.PutFiles(localOrdersDir & "*.*", remoteOrdersDir, False, transferOptions)
' Throw on any error
transferResult.Check
' Print results
For Each transfer In transferResult.Transfers
objFSO.MoveFile transfer.filename, localOrdersDir & "transmitted\"
objLogFile.WriteLine("Uploading " & Replace(transfer.filename, "\\MSL-SERVER\SchuyLab\schuylab\Labcorp\Labcorp orders\", "") & " completed on " & CStr(now()))
'WScript.Echo "Upload of " & transfer.FileName & " succeeded"
Next
Set transferResult = Nothing
' ----- Download files
Set transferResult = session.GetFiles(remoteResultsDir & "*.*", localResultsDir, False, transferOptions)
' Throw on any error
transferResult.Check
' Print results
For Each transfer In transferResult.Transfers
'WScript.Echo "Download of " & transfer.FileName & " succeeded"
objLogFile.WriteLine("Downloading " & Replace(transfer.filename, remoteResultsDir,"") & " completed on " & CStr(now()))
Next
Set transferResult = Nothing
lastRunTime = Now()
End If
End IF
WScript.Sleep 1000
curDateTime = Now()
Loop
Thank you in advance for your helpful advise :-)
I have a problem utilizing a PutFiles command in my script. It picks up only one file at a time instead of taking all files in the directory as specified. However, GetFiles pulls all files. Please, please, please advise A.S.A.P. Following is the part of the script I have a problem with:
Do while true
if ie.document.all("continue").Value = "no" then
ie.Quit
exit Do
end if
If DateDiff("s", lastRunTime, curDateTime) > 60 then
If Minute(curDateTime) = 29 or Minute(curDateTime) = 59 Then
' ----- Upload files
Set transferResult = session.PutFiles(localOrdersDir & "*.*", remoteOrdersDir, False, transferOptions)
' Throw on any error
transferResult.Check
' Print results
For Each transfer In transferResult.Transfers
objFSO.MoveFile transfer.filename, localOrdersDir & "transmitted\"
objLogFile.WriteLine("Uploading " & Replace(transfer.filename, "\\MSL-SERVER\SchuyLab\schuylab\Labcorp\Labcorp orders\", "") & " completed on " & CStr(now()))
'WScript.Echo "Upload of " & transfer.FileName & " succeeded"
Next
Set transferResult = Nothing
' ----- Download files
Set transferResult = session.GetFiles(remoteResultsDir & "*.*", localResultsDir, False, transferOptions)
' Throw on any error
transferResult.Check
' Print results
For Each transfer In transferResult.Transfers
'WScript.Echo "Download of " & transfer.FileName & " succeeded"
objLogFile.WriteLine("Downloading " & Replace(transfer.filename, remoteResultsDir,"") & " completed on " & CStr(now()))
Next
Set transferResult = Nothing
lastRunTime = Now()
End If
End IF
WScript.Sleep 1000
curDateTime = Now()
Loop
Thank you in advance for your helpful advise :-)