Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

lew

Hi Martin,

thank you very much for pointing out that console/Main.cpp is the place to adapt the code to my needs. That saves me work and time.

Best regards,
Lew
martin

Re: WinSCP.com control via parent process through pipes

Yes, the winscp.com behaves differently when its stdin/stdout are pipes or files (rather than a console).
Of course, you can alter the console/Main.cpp to change this.
Alternatively (though that's a lot of work) you can replace the winscp.com completely and interact with winscp.exe directly (like WinSCP .NET assembly does).
lew

WinSCP.com control via parent process through pipes

Hi Martin & the WinSCP community,

first of all I would like to express my special thanks to you, Martin, for providing such a great tool to the public. WinSCP is very useful and makes our (file-transfer-) lives easier.

To run WinSCP.com scripted is a good thing, but not enough for me. I want to use WinSCP 5.2.3 beta's file transfer capabilities to automatize some more sophisticated tasks. To do this I wrote a C program that launches WinSCP.com as a child process (via CreateProcess) and creates some anonymous pipes. These pipes are connected to WinSCP.com's stdout and stdin. It works, the main program can read WinSCP's output and can command it.

But it can not switch off batch mode. The main program sends batch off to WinSCP, WinSCP confirms that and ignores it! It behaves like it would run a script. It decides to answer user questions automatically in a way I don't want. I did all the work with the C main program to have the control (like a human user of WinSCP.com would have) to implement a more complex logic than a WinSCP script can have.

Is this a bug or a feature? How does WinSCP even know it is run by a program and not by a user? Does WinSCP observe its stdout and stdin handlers and switch automatically and forcibly to batch mode if there is no standard shell connected to the handlers?

Could you enable to control WinSCP.com from a parent process via stdin and stdout completely? This would be fantastic!

Best regards,
Lew