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

Advertisement

3K
Donor
Joined:
Posts:
32
Location:
Geneva

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. :)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

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

Reply with quote

3K
Donor
Joined:
Posts:
32
Location:
Geneva

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. :)

Reply with quote

lochun
Guest

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. :)

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum