Using WinSCP Version 5.0.0 (Build 1431)
Here is my script:
option batch abort
option confirm off
option transfer automatic
option reconnecttime 180
option exclude "*/"
open ftps://username:password@domain -passive -implicit
synchronize remote -mirror -criteria=time %1% %2%
exit
If I execute this at commandline:
WinSCP.com /timeout=180 /script="test.txt" /parameter "C:\path" "/path"
I get this returned (note that '%2%' did not resolve):
batch abort
confirm off
transfer automatic
reconnecttime 180
exclude */
Connecting to domain ...
Connected with domain:port, negotiating SSL connection...
SSL connection established. Waiting for welcome message...
Connected
Starting the session...
Reading remote directory...
Session started.
Active session: [1] username@domain
Comparing...
Local 'C:\path' => Remote '%2%'
Error listing directory '%2%'.
Could not retrieve directory listing
CWD failed. "/%2%": directory not found.
(A)bort, (R)etry, (S)kip: Abort
If I execute this at commandline (note absence of "/" as first char of remote path):
WinSCP.com /timeout=180 /script="test.txt" /parameter "C:\path" "path"
I get this returned (note that '%2%' correctly resolved to remote 'path' this time):
batch abort
confirm off
transfer automatic
reconnecttime 180
exclude */
Connecting to domain ...
Connected with domain:port, negotiating SSL connection...
SSL connection established. Waiting for welcome message...
Connected
Starting the session...
Reading remote directory...
Session started.
Active session: [1] username@domain
Comparing...
Local 'C:\path' => Remote 'path'
Synchronizing...
It appears that "/" as first character, when within quotes as in "/path" causes the second parameter not to resolve.