Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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)


Topic review


Re: Log File not being created

WinSCP get confused by the .xml extension. You have to use another one. The session log is not XML, it's a plain text file. Use for example "C:\WinSCPLogs\test.log".

Still not sure why it is not logging, but I figured out the issue that I needed the log. Remote folder path is case sensitive. I'd like to get the logging working, but it can be prioritized lower.

FYI I just tried 5.7.7 still no luck (as well as the new 5.7.7 .NET dll). I know the code is executing, because at the end I do a send-mail and that comes through.

Log File not being created

I'm not sure what I am doing wrong. I have a power script that uses the below code. It won't create the log file. The folder exists, and I have full rights to it. I can created and delete files there just fine. I am using 5.7.6

# Load WinSCP .NET assembly
Add-Type -Path "C:\Program Files (x86)\WinSCP\WinSCPnet.dll"

# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::ftp
$sessionOptions.HostName = ""
$sessionOptions.UserName = "*****"
$sessionOptions.Password = "*****"
$session = New-Object WinSCP.Session
$session.SessionLogPath = "C:\WinSCPLogs\test.xml"

# Connect