WinSCP version: 5.21.1
Hi,
Is it possible to pass a parameter to a Bat file and then from the Bat file to a WinSCP DOS Script to specify the destination file name within the
put command?
For example -
My Bat file contains the following command -
Winscp.com /ini=nul /script=Mycripts\FTPS-to-site.txt /XMLlog=%5.xml /loglevel=1 /parameter %1 %2 %3 %4 %6
I am calling the Bat file with 6 values being passed to it.
One of the lines in my WinSCP script "FTPS-to-Site.txt" is -
put -preservetime "%3%"\"%4%" %6%
Where
%3% is the source path and
%4% the file name.
%6% should be the new file name value.
I have tried different variations like
%6,
"%6%",
%%6% which all result in the destination file being named
%6% or
%6 etc... It seems WinSCP is taking any text entered after the
"%4%" literally and not as a parameter.
Any suggestions please?
Thanks.