Bat file Console : password contains double quote -> error Too many parameters for command 'open'

Advertisement

starhu
Joined:
Posts:
2

Bat file Console : password contains double quote -> error Too many parameters for command 'open'

Hello,

My FTP password contains double quote and WinSCP gives error
Too many parameters for command 'open'
The script is like this:
d:\WindowsPrgUp\WinSCP\winscp.com /command "open ftp://abc.def.com:"KfrHx84!95%"@def.com/" "put  c:\MyFolder\xyz\_ExeOutPut\rtz.exe /update/customers/rtz.exe"
What can I do? I tried one more double code, surrounding the password with quotes but it didn't work. Thank you for your help!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,405
Location:
Prague, Czechia

Re: Bat file Console : password contains double quote -> error Too many parameters for command 'open'

There are two double quotes in your password. Are both parts of the password? Or just one of them?
If both, the code should be:
"open ftp://abc.def.com:""KfrHx84!95%""@def.com/"
See https://winscp.net/eng/docs/commandline#syntax
Alternatively, you can URL-encode the quote:
https://winscp.net/eng/docs/session_url#special
(what you should do with the percent sign too)

The easiest is to have WinSCP GUI generate the script for you:
https://winscp.net/eng/docs/ui_generateurl#script

Reply with quote

starhu

Re: Bat file Console : password contains double quote -> error Too many parameters for command 'open'

Thank you Martin,
I generated the script and it works well!

Reply with quote

Advertisement

You can post new topics in this forum