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

lochun

Hi 3K

Hi 3K the file myconsole.txt is blank for me when i am trying to concatenate the output in the text file. which version of WINSCP you are using plse?

my code is

"C:\Program Files\WinSCP\winscp.exe" /console /log="mylogfile.txt" /xmllog="myxmllog.xml" /script="test.txt" >myconsole.txt

Thank you in Advance.




3K wrote:

I've tried the command below where it saved the console output to myconsole.txt. However, when I opened it, there is no line break/return key. Any idea how to insert a line break automatically?

winscp /log="mylogfile.txt" /xmllog="myxmllog.xml" /script="test.txt" >myconsole.txt

Thank you. :)
martin

There are line breaks, but unix style. Some viewer/editors cannot handle that.

Anyway it was fixed already:
https://winscp.net/tracker/812
3K

I've tried the command below where it saved the console output to myconsole.txt. However, when I opened it, there is no line break/return key. Any idea how to insert a line break automatically?

winscp /log="mylogfile.txt" /xmllog="myxmllog.xml" /script="test.txt" >myconsole.txt

Thank you. :)
martin

Re: Saving the console output to a text file? then hide console

I recommend you use XML logging:
https://winscp.net/eng/docs/logging_xml

If you insist on what you see on the console, you would have to write a wrapping application or script that runs hidden WinSCP, and redirects its output into its own stream.
https://winscp.net/eng/docs/guide_automation_advanced

Or use .NET assembly with its Session.OutputDataReceived event
https://winscp.net/eng/docs/library_session_outputdatareceived
3K

Saving the console output to a text file? then hide console

When running a script, a console output appears showing a concise status. How can I save this console output to a text file and hide the console? (I use the /log="logfile.txt" but it's long.)

Thank you. :)