Topic "syntax for using /parameter variables with /command"

Author Message
henry3
[View user's profile]

Joined: 2016-03-20
Posts: 10
this does not seem to work in a batch file using /command and /parameter
"synchronize remote "%1%" "%2%"" "exit"
it works fine in a script
synchronize remote -delete "%1%" "%2%"
exit
Advertisements
henry3
[View user's profile]

Joined: 2016-03-20
Posts: 10
It appears after some testing with the log file that the syntax is:
Code:
"synchronize remote "%%1%%" "%%2%%"" "exit"
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26911
Location: Prague, Czechia
The correct syntax is:
"synchronize remote ""%%1%%"" ""%%2%%""" "exit"

See https://winscp.net/eng/docs/commandline#syntax
henry3
[View user's profile]

Joined: 2016-03-20
Posts: 10
Thanks Martin, I wasn't sure I needed to escape both the " and %
Henry
Advertisements

You can post new topics in this forum

Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License