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

martin

Re: Can't create logfile

Guest2 wrote:

call c:\winscp\winscp.com /console /script="\\server\folder\script.txt /log="\\server\folder\log.txt"

You are missing quote after script.txt.
Let us know if it helps.
Guest2

Can't create logfile

I have a similar, but not the same, problem...
I have only a single batch file that issues the command
call c:\winscp\winscp.com /console /script="\\server\folder\script.txt /log="\\server\folder\log.txt"

The script runs, transfers the files, everything is fine but there is no log file created.
When running it, I see the following in the command window:

call c:\winscp\winscp.com /console /script="\\server\folder\script.txt /log="\\server\folder\log.txt"
batch on
confirm off
141
Can't open log file '\\server\folder\log.txt
... and then on to transferring the files as normal.

ideas? Is there a way to specify the logfile in the script instead?
martin

Anonymous wrote:

1. batch opens another and writes 1&2 logs to log.txt
bat1.bat>>log.txt 2>&1
2. second bat opens the script with
WinSCP.com /script=scpscript.txt /log=log.txt
second bat does other commands too after exiting the script.

And that's exactly the problem I've pointed you to in my first reply. You cannot write to a single file from two processes.
Guest

1. batch opens another and writes 1&2 logs to log.txt
bat1.bat>>log.txt 2>&1
2. second bat opens the script with
WinSCP.com /script=scpscript.txt /log=log.txt
second bat does other commands too after exiting the script.
martin

Anonymous wrote:

thats the reason why i use >> instead of >
logs of more passes in 1 logfile

Where do you use >>? You have never mentioned that.
Guest

logfile is overwritten with "blah".

thats the reason why i use >> instead of >
logs of more passes in 1 logfile
martin

I've been asking what does happen if you execute the command below in the same directory where you are executing WinSCP.

echo blah > log.txt
Guest

yes batch, winscpscript and logfile in the same folder
martin

So what does happen if you do e.g.
echo blah > log.txt

in the same directory?
Guest

i am putting the winscp log in the same logfile like my winscp-starting batch-file.
doesn't work in that way?
martin

Re: Logfile error

The above is not what log file should look like. It is regular output of the script. It looks like you are actually doing:
WinSCP.com /script=scpscript.txt /log=log.txt > log.txt
Guest

Logfile error

Hi there,
i have a extern winscp-script, opened via a batch file.
i'm opening with the following parameters:

WinSCP.com /script=scpscript.txt /log=log.txt

in my logfile, the first lines are:

batch on
confirm off
Error occured during logging. It's been turned off.
Can't open log file 'log.txt'.
Searching for host...
Connecting to host...
Authenticating...


there is an existing file called log.txt in the same folder as the batch and the winscp script. forgot anything?
ps: read doc and faq a few times before but still without an idea.

thanks