I have the code at the bottom of this post inside one of my excel books (my first time ever writing vba code). The goal here is to allow users to:
In WinSCP script, you want:
put "path with space"
See Command parameters with spaces.
On WinSCP command line, you have to enclose each command to a double quotes and double all double quotes in the command itself:
"put ""path with space"""
See WinSCP command-line syntax.
In VB you need to enclose the string in double quotes and double all double quotes in the string itself:
"""put """"path with space"""""" "
And to replace the path with a variable, substitute the path with space
with " & RealFile & "
.
This gives you:
"""put """"" & RealFile & """"""" "