Re: Can I use a variable to repeat a get -filemask destination path
You can set an environment variable in the parent batch file:
and use it in WinSCP script like:
See https://winscp.net/eng/docs/scripting#variables
(Note that in your script the empty
Another option is:
Upload to multiple servers / Parametrized script
Or you can just change the remote working directory:
Or specify the multiple sources in one command:
Or even simplify the mask using set pattern to:
https://winscp.net/eng/docs/file_mask#basic
set DESTINATION=\\192.168.1.10\fixeddestination\
and use it in WinSCP script like:
get fileA*.txt>today %DESTINATION%
See https://winscp.net/eng/docs/scripting#variables
(Note that in your script the empty
-filemask
is redundant)
Another option is:
Upload to multiple servers / Parametrized script
Or you can just change the remote working directory:
Or specify the multiple sources in one command:
get fileA*.txt>today fileB*.txt>today fileC*.txt>today \\192.168.1.10\fixeddestination\
Or even simplify the mask using set pattern to:
get file[ABC]*.txt>today \\192.168.1.10\fixeddestination\
https://winscp.net/eng/docs/file_mask#basic