I am having a problem using PSCP in a C# program to copy a file from a Unix machine to a Windows machine. The problem only happens when the target folder on the Windows machine has a space in it. For example, the following works fine: (NOTE: the IP address and password have been changed for this example)
pscp.exe -pw MyPassword root@127.0.0.1:/etc/myfolder/myfile.opt C:\download
But when I change it to this:
pscp.exe -pw MyPassword root@127.0.0.1:/etc/myfolder/myfile.opt C:\download files
I get the following error: More than one remote source not supported.
I realize that is because PSCP inteprets the space as another target. But how can I do it? I have tried all kinds of things like putting it in quotes and escaping the space. I have tried all of the following and nothing works:
pscp.exe -pw MyPassword root@127.0.0.1:/etc/myfolder/myfile.opt "C:\download files"
pscp.exe -pw MyPassword root@127.0.0.1:/etc/myfolder/myfile.opt C:\"download files"
pscp.exe -pw MyPassword root@127.0.0.1:/etc/myfolder/myfile.opt C:\download\\ files
Any ideas?