Thanks for clarification Martin.
I changed my VBA code like below & it worked and created the log file dynamically:
------------------------
Call Shell("C:\Program Files (x86)\WinSCP\WinSCP.com /script=C:\test\autowinscp\autowinscp.txt /log=C:\test\autowinscp\winscp.log", vbNormalFocus)
------------------------
I am looking for few other clarifications on simple log file.
Is it possible or is there an option strip log file to display less number of lines, instead 40 lines of log (this number I just counted number of default rows in log file between start and EOF message)
All I need is below line, along with start and end, I took these three lines from current log file which has 37 other lines with other parameters which may not required.
------------------------
. 2016-09-12 09:36:02.571 Started a shell/command
. 2016-09-12 09:36:03.042 Script: Drwxrwxrwx 0 0 Sep 12 9:36:03 2016 ..
. 2016-09-12 09:36:03.045 Sent EOF message
------------------------
Please let me know if there are options to turn of other parameters in log file.
Thank you.
Have a nice day!
martin wrote:
It seem that you combine WinSCP script with a batch file/WinSCP command-line in a single file.
In VBA, you have to call a command like:
C:\Program Files (x86)\WinSCP\WinSCP.com /script="c:\test\winscp.txt" /log="C:\test\autowinscp\winscp.log"
Where the
winscp.txt
should contain:
open sftp://username:example.com:10022/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
echo connected to username mailbox...
get *.zip
ls
exit