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

Author Message
cyrusv
[View user's profile]

Joined: 2017-09-22
Posts: 1
Location: PNW
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!
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
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

Quote:
::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.
Advertisements

You can post new topics in this forum

Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License