I have upgraded to version 4.2.5 and it still does not work.
I don't agree that it's the script that's at fault because all that is doing is mimicing commandline instructions. In most programs double quotes " " are added at the start and end of a UNC path which contains a blank space so it is seen as a single string, however WinSCP does not appear to be able to handle this kind of UNC path (albeit very commonly used in directory names).
ie In a command Prompt, if you wanted to change the directory from C:\ to the Winscp folder you have to send the following command cd "Program files\Winscp" the use of the double quotes because of the blank space in the Program Files directory.
Even if I run this commandline manually from a command prompt
C:\Program Files\WinSCP>winscp.exe /console /command "open bXXXX\BXXXX:HXXXXX@f
tp.bXXXX.co.uk" "option confirm off" "put D:\Test\BXXXX\my test\more test\test\ /Home/bXXX-BXXX/Test"
"exit"
I still get the same following error
Searching for host...
Connecting to host...
Authenticating...
Using username "bXXXX\BXXXX".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] bXXXX\[email protected]
confirm off
File or folder 'D:\Test\BOXIT\my' does not exist.
System Error. Code: 2.
The system cannot find the file specified
(A)bort, (R)etry, (S)kip, Ski(p) all:
It does appear that WinSCP is unable to handle UNC paths with blank spaces, unless it works in a different way in which another kind of annotation is used so the path is seen as a full string instead of broken paths by the blank spaces.
Is this a bug in the program...?