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: Using /log and /parameter at the same time not working

cyrusv wrote:

::Sends files OK but doesn't create log
WinSCP.com /script="%scriptsdir%\put_files.txt" /parameter // "%dailydir%" /log="C:\LOGFILE_!Y!M!D.log"

That's because of the //. It tells WinSCP to treat all following parameters as plain parameters, newer as switches.
Just remove the //.
See https://winscp.net/eng/docs/commandline#syntax

::Fails to send files or create log
WinSCP.com /script="%scriptsdir%\put_files.txt" /log="C:\LOGFILE_!Y!M!D.log" /parameter // "%dailydir%"

This works for me.
cyrusv

Using /log and /parameter at the same time not working

I am trying to call the com interface in a batch file with both /parameter and /log at the same time. Below is what I am encountering:

::Sends files with parameter OK
WinSCP.com /script="%scriptsdir%\put_files.txt" /parameter // "%dailydir%"

::Sends files with out parameter and creates log OK
WinSCP.com /script="%scriptsdir%\put_files.txt" /log="C:\LOGFILE_!Y!M!D.log"

::Sends files OK but doesn't create log
WinSCP.com /script="%scriptsdir%\put_files.txt" /parameter // "%dailydir%" /log="C:\LOGFILE_!Y!M!D.log"

::Fails to send files or create log
WinSCP.com /script="%scriptsdir%\put_files.txt" /log="C:\LOGFILE_!Y!M!D.log" /parameter // "%dailydir%"

Anybody have any ideas? I am running version 5.9.1 of WinSCP. Thanks!