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

mreinsmith

I used the following to activate the script

C:\Progra~2\WinSCP\winscp.exe /console /script=transfer.txt /xmllog=%USERPROFILE%\Desktop\transfer_!S.log /nointeractiveinput

it creates 4 separate logs, but at least I can easily verify the results

Thanks for your help

M
martin

Re: error 141 can't open log file

I cannot reproduce your problem with any version of WinSCP. What version are you using?

Anyway, it's not a good idea to log all sessions into one file (one would overwrite the other). Consider using some session-specific pattern in the log path. E.g. !S:
C:\Progra~2\WinSCP\winscp.exe /console /script=transfer_!S.txt /xmllog=transfer.log /nointeractiveinput

See https://winscp.net/eng/docs/ui_pref_logging#session_log
mreinsmith

error 141 can't open log file

I run a batch file with the following command

C:\Progra~2\WinSCP\winscp.exe /console /script=transfer.txt /xmllog=transfer.log /nointeractiveinput

it runs the script 'transfer.txt' as shown here

option batch on
option confirm off
option transfer ascii
open sftp://root:password1@server1 -hostkey=*
lcd V:\test
cd /remote1
mput *.xml
cd /remote2
mput *.xml

open sftp://root:password2@server2 -hostkey=*
cd /remote1
mput *.xml
cd /remote2
mput *.xml

open sftp://root:password3@server3 -hostkey=*
cd /remote1
mput *.xml
cd /remote2
mput *.xml

open sftp://root:password4@server4 -hostkey=*
cd /remote1
mput *.xml
cd /remote2
mput *.xml

it correctly logs the result for "server1" but after it connects to server2 i get the error "141 can't open log file 'transfer.log'

the log then is written to V:\test (the local directory shown above) and server2 logs correctly to that copy.

from there, SERVER3 and SERVER4 don't get logged anywhere

any ideas how to correct this behaivor?

Thank You

M