I have a command procedure which calls a separate command procedure to execute WinSCP. So the top level command procedure calls SFTP-Put-WinSCP.cmd like;
The file SFTP-Put-WinSCP.cmd looks like;
"C:\Program Files (x86)\WinSCP\WinSCP.exe" /script="D:\MyFolder\SFTPPutScript.txt" /loglevel=0 /log=D:\FCDSLexisNexis\Log\WinSCPPut.log"
SFTPPutScript.txt Looks like;
put D:\MyFolder\RequestFiles\MyRequest-%1.txt incoming/MyRequest-%1.txt
I am expecting to send the file D:\MyFolder\RequestFiles\MyRequest-20201210-183003.txt to the remote server, but I get an error message;
File or folder 'D:\MyFolder\RequestFiles\MyRequest-%1.txt incoming/MyRequest-%1.txt' does not exist. ("System Error. Code: 2.
I am sure I am not passing parameters correctly. When I add the
switch using either space or equals sign it stops writing to the log and it doesn't send the file. One example of what I tried is;
"C:\Program Files (x86)\WinSCP\WinSCP.exe" /script="D:\FCDSLexisNexis\SFTPPutScript.txt" /loglevel=0 /log=D:\FCDSLexisNexis\Log\WinSCPPut.log" /parameter %1
So the question is, where can I find good examples doing what I need to do?