Differences

This shows you the differences between the selected revisions of the page.

2019-05-28 2021-03-30
5.12 Bug 1589 – Use SHA-256 host key fingerprints (martin) using compound statement + cd + not hiliting "exit" + config isolation + logging (martin)
Line 52: Line 52:
===== [[scripting]] Using WinSCP Scripting ===== ===== [[scripting]] Using WinSCP Scripting =====
-You may use following batch file that calls WinSCP [[scripting|script]]:+You may use following batch file that calls generated WinSCP [[scripting|script]]:
<code batch> <code batch>
@echo off @echo off
-set SESSION=sftp://user:password@example.com/+set SESSION=sftp://user:password;fingerprint=ssh-rsa-xxxxxxxxxxx...=@example.com/
set REMOTE_PATH=/home/user/ set REMOTE_PATH=/home/user/
-echo open %SESSION% >> script.tmp+
 +··echo open %SESSION% 
 +  echo <nohilite>cd</nohilite> %REMOTE_PATH%
-rem Generate "put" command for each line in list file +··rem Generate "put" command for each line in list file 
-for /F %%i in (list.txt) do echo put "%%i" "%REMOTE_PATH%" >> script.tmp+··for /F %%i in (list.txt) do echo put "%%i"
-echo exit·>> script.tmp+··echo <nohilite>exit</nohilite> 
 +) > script.tmp
-winscp.com /script=script.tmp+winscp.com /ini=nul /log=script.log /script=script.tmp
set RESULT=%ERRORLEVEL% set RESULT=%ERRORLEVEL%

Last modified: by martin