how to get /Command put work with Filenames having spaces

Advertisement

CCR
Guest

how to get /Command put work with Filenames having spaces

hello,
i hope someone had that problem before or i am just to stupid.
i did escape everything i could, but i could't get this statement work properly. i must have it scripted since it is for automation

WinScp3.com /command "open me@myserver" "put "C:\Documents and Settings\SomePath\SomeFile.txt" "Projekte"" close exit

i though double escaping is necessary (i can't get it work without anyway).

help is highly appreciated
thanks in advance

Reply with quote

Advertisement

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

Re: how to get /Command put work with Filenames having spaces

I do not think it is possible due to limitations of Windows shell.

Reply with quote

RickB
Guest

Re: how to get /Command put work with Filenames having space

CCR wrote:

hello,
i hope someone had that problem before or i am just to stupid.
i did escape everything i could, but i could't get this statement work properly. i must have it scripted since it is for automation

WinScp3.com /command "open me@myserver" "put "C:\Documents and Settings\SomePath\SomeFile.txt" "Projekte"" close exit

i though double escaping is necessary (i can't get it work without anyway).

help is highly appreciated
thanks in advance

I know you have found a workaround but for the record here is a possible solution.
I had this problem and solved it by using the short (8dot3) version of the path. For example, you could do this instead:

WinScp3.com /command "open me@myserver" "put C:\DOCUME~1\SOMEPA~1\SOMEFI~1.txt Projekte"

The exact 8dot3 names of your directories and files may no be what I have typed above, but probably is. you can open a command prompt and type DIR /X and you will see the short 8dot3 names in the DIR listing.

Reply with quote

Advertisement

You can post new topics in this forum