0

In my SQR program, I am using call system USING

$ftpCommand #sendStatus WAIT 

to grab a file from a FTP server. The $ftpCommand is:

C:\Windows\system32\cmd.exe /c E:\PS\psoft\dev\sqr_custom\ftp_from.bat 

The ftp_from.bat contains one line:

"C:\Program Files (x86)\WinSCP\WINSCP.EXE" /console /script=\\servername\ps\psoft\dev\sqr_custom\cust_download.txt

The cust_download.txt is as following:

option batch on
option confirm off
open ftpservername
lcd localdirectoryname
option transfer ascii
echo 11111
get thefile.csv
close
exit

But the SQR errored out. I added echo to the cust_download.txt file, but can not see the echoed statement in SQR .out file.

So my question is why the FTP process does not work? And how to see my echoed message in the windows script?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Jessica
  • 41
  • 1
  • 3

1 Answers1

0

Change your ftp_from.bat to:

set LOG=C:\some_writtable_folder\winscp.log
echo Before WinSCP > %LOG%
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script=\\servername\ps\psoft\dev\sqr_custom\cust_download.txt" >> %LOG%
echo After WinSCP >> %LOG%

Note the WinSCP.com instead of WinSCP.exe.

And inspect the winscp.log file.

If it does not help, share the log file with us (edit your question).

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992