Topic " does not parse \" escapes in the command line"

Author Message
[View user's profile]

Joined: 2015-03-16
Posts: 2
Most Windows programs understand a double quote that's escaped either by doubling it ("") or by using a backslash (\"). That's what CommandLineToArgvW understands, which is used by most standard libraries on Windows.

It seems likely that WinSCP parses the command line entirely by itself, thus introducing an incompatibility with this standard. It understands "" but not \". Can support for \" be added please?

Here's an example of a command that WinSCP can't parse:

Code: /command "open sftp://.... -hostkey=\"ssh-dss 1024 aa:bb:..:88:99\"" exit
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27086
Location: Prague, Czechia
It would be a backward-incompatible change. What do you need it for?

Last edited by martin on 2015-03-19; edited 1 time in total
[View user's profile]

Joined: 2015-03-16
Posts: 2
Hm, you have a point. I "need" it mostly because I wasted quite a bit of time figuring out a weird "Host key does not match configured key" message, which in the end turned out to be due to this. I was passing in raw arguments to another program, which was constructing the actual command line for WinSCP by escaping " with \". I thought it could save someone else some time if WinSCP supported that.

Well, it's your call then. I realise WinSCP is used in lots of scripts around the world and breaking those would be a Bad Thing.

P.S. Random idea: there could be a wrapper that does nothing but convert the command line and pass it to Seems a bit overkill though.

You can post new topics in this forum


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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License