Copy a directory with a space in its name

Advertisement

moshikofeldman
Joined:
Posts:
1

Copy a directory with a space in its name

Hi,
I'm trying to use the following command to copy a folder from a Windows machine to Linux:
source: d:\my test
target: /root/Desktop

> winscp.com myuser:mypass@1.2.3.4 /command "put d:\my test /root/Desktop/"
(It is important to say that the same command works with a simple source folder name, such as d:\test)

it fails, of course, and reports that the folder "d:\my" doesn't exist.

I've tried some variations, such as
> winscp.com myuser:mypass@1.2.3.4 /command "put \"d:\my test\" /root/Desktop/"

but none of them works. How can I quote the source folder name inside a put command, in order for it to be understood correctly?

Thank you!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Copy a directory with a space in its name

Double them.
And make sure you open the session using open command as well.
winscp.exe /console /command "open myuser:mypass@1.2.3.4" "put ""d:\my test"" /root/Desktop/"

Last edited by martin on 2009-10-07; edited 1 time in total

Reply with quote

Apurva
Guest

Similar problem but with hostkey

I am using the following command:
>winscp.com /command "open username:pwd@host:22 -hostkey="ssh-dss 1024 b0:ed:e0:fg:cd:55:f6:6c:cf:ff:70:ed:68:bc:3e:1c""

It first does not take the hostkey and give me
Unknown command '1024'.
Unknown command 'b0:ed:e0:fg:cd:55:f6:6c:cf:ff:70:ed:68:bc:3e:1c'

I've tried doubling the quotes like this
>winscp.com /command "open username:pwd@host:22 -hostkey=""ssh-dss 1024 b0:ed:e0:fg:cd:55:f6:6c:cf:ff:70:ed:68:bc:3e:1c"""

and I get the error - too many parameters for command 'open'

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Similar problem but with hostkey

First make sure you use the latest version. Then, the double-quoting does not work with winscp.com yet. See tracker.

Reply with quote

Advertisement

You can post new topics in this forum