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

Advertisement

cyrusv
Joined:
Posts:
1
Location:
PNW

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!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,276
Location:
Prague, Czechia

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#two_slashes

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

Reply with quote

Advertisement

You can post new topics in this forum