Passing parameters to script file...
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;
SFTPPutScript.txt Looks like;
I am expecting to send the file D:\MyFolder\RequestFiles\MyRequest-20201210-183003.txt to the remote server, but I get an error message;
So the question is, where can I find good examples doing what I need to do?
SFTP-Put-WinSCP.cmd 20201210-183003
"C:\Program Files (x86)\WinSCP\WinSCP.exe" /script="D:\MyFolder\SFTPPutScript.txt" /loglevel=0 /log=D:\FCDSLexisNexis\Log\WinSCPPut.log"
open "sftp://MyUser:MyPassword@My.SFTPDomain.com/" put D:\MyFolder\RequestFiles\MyRequest-%1.txt incoming/MyRequest-%1.txt exit
I am sure I am not passing parameters correctly. When I add theFile or folder 'D:\MyFolder\RequestFiles\MyRequest-%1.txt incoming/MyRequest-%1.txt' does not exist. ("System Error. Code: 2.
/parameter
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