sorry for my late reply. I though I would receive email notification upon replies. Here's what you requested.
@echo off
"C:\Program Files (mine)\WinSCP\WinSCP.com" ^
/log="C:\temp\WinSCP.log" /ini=nul ^
/command ^
"open scp://xpto:temppass@16.142.123.226/ -hostkey=""ssh-ed25519 255 6111asdeQSwYxfhhcNsad3XVmgScclL2Smgf85ucQ="" -privatekey=""C:\temp\id_rsa.ppk"" -rawsettings AuthGSSAPI=0 Tunnel=1 TunnelHostName=""16.142.123.226"" TunnelUserName=""xpto"" TunnelPublicKeyFile=""C:%%5Ctemp%%5Cid_rsa.ppk"" TunnelPasswordPlain=""temppass""" ^
"put C:\temp\x.log x.log" ^
"exit"
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)
exit /b %WINSCP_RESULT%
. 2021-02-26 18:48:37.082 --------------------------------------------------------------------------
. 2021-02-26 18:48:37.083 WinSCP Version 5.17.10 (Build 11087) (OS 10.0.14393 - Windows 10 Enterprise 2016 LTSB)
. 2021-02-26 18:48:37.083 Configuration: nul
. 2021-02-26 18:48:37.083 Log level: Normal
. 2021-02-26 18:48:37.083 Local account: IANAP\mylanuser
. 2021-02-26 18:48:37.083 Working directory: C:\temp
. 2021-02-26 18:48:37.083 Process ID: 9524
. 2021-02-26 18:48:37.084 Command-line: "C:\Program Files (mine)\WinSCP\WinSCP.exe" /console=5.17.10 /consoleinstance=_23684_832 "/log=C:\temp\WinSCP.log" "/ini=nul" "/command" "open scp://xpto:***@16.142.123.226/ -hostkey=""ssh-ed25519 255 6111asdeQSwYxfhhcNsad3XVmgScclL2Smgf85ucQ="" -privatekey=""C:\temp\Jirnexu\id_rsa.ppk"" -rawsettings AuthGSSAPI=0 Tunnel=1 TunnelHostName=""16.142.123.226"" TunnelUserName=""xpto"" TunnelPublicKeyFile=""C:%5Ctemp%5Cid_rsa.ppk"" TunnelPasswordPlain=***" "put C:\temp\x.log x.log" "exit"
. 2021-02-26 18:48:37.084 Time zone: Current: GMT+8 (Malay Peninsula Standard Time), No DST
. 2021-02-26 18:48:37.084 Login time: Friday, February 26, 2021 6:48:37 PM
. 2021-02-26 18:48:37.084 --------------------------------------------------------------------------
. 2021-02-26 18:48:37.084 Script: Retrospectively logging previous script records:
> 2021-02-26 18:48:37.084 Script: open scp://xpto:***@16.142.123.226/ -hostkey="ssh-ed25519 255 6111asdeQSwYxfhhcNsad3XVmgScclL2Smgf85ucQ=" -privatekey="C:\temp\Jirnexu\id_rsa.ppk" -rawsettings AuthGSSAPI=0 Tunnel=1 TunnelHostName="16.142.123.226" TunnelUserName="xpto" TunnelPublicKeyFile="C:%5Ctemp%5Cid_rsa.ppk" TunnelPasswordPlain=***
. 2021-02-26 18:48:37.084 --------------------------------------------------------------------------
. 2021-02-26 18:48:37.084 Session name: xpto@16.142.123.226 (Ad-Hoc site)
. 2021-02-26 18:48:37.084 Host name: 16.142.123.226 (Port: 22)
. 2021-02-26 18:48:37.084 User name: xpto (Password: Yes, Key file: Yes, Passphrase: No)
. 2021-02-26 18:48:37.084 Tunnel: Yes
. 2021-02-26 18:48:37.084 Tunnel: Host name: 16.142.123.226 (Port: 22)
. 2021-02-26 18:48:37.084 Tunnel: User name: xpto (Password: Yes, Key file: Yes)
. 2021-02-26 18:48:37.084 Tunnel: Local port number: 0
. 2021-02-26 18:48:37.084 Transfer Protocol: SCP
. 2021-02-26 18:48:37.084 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2021-02-26 18:48:37.084 Disable Nagle: No
. 2021-02-26 18:48:37.084 Proxy: None
. 2021-02-26 18:48:37.084 Send buffer: 262144
. 2021-02-26 18:48:37.085 SSH protocol version: 2; Compression: No
. 2021-02-26 18:48:37.085 Bypass authentication: No
. 2021-02-26 18:48:37.085 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2021-02-26 18:48:37.085 Ciphers: aes,chacha20,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2021-02-26 18:48:37.085 KEX: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2021-02-26 18:48:37.085 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2021-02-26 18:48:37.085 Simple channel: Yes
. 2021-02-26 18:48:37.085 Return code variable: Autodetect; Lookup user groups: Auto
. 2021-02-26 18:48:37.085 Shell: default
. 2021-02-26 18:48:37.085 EOL: LF, UTF: Auto
. 2021-02-26 18:48:37.085 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2021-02-26 18:48:37.085 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No; Exit code 1 is error: No
. 2021-02-26 18:48:37.085 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2021-02-26 18:48:37.085 Cache directory changes: Yes, Permanent: Yes
. 2021-02-26 18:48:37.085 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2021-02-26 18:48:37.085 DST mode: Unix;Timezone offset: 0h 0m
. 2021-02-26 18:48:37.085 --------------------------------------------------------------------------
. 2021-02-26 18:48:37.085 Opening tunnel.
. 2021-02-26 18:48:37.088 Autoselected tunnel local port number 50001
. 2021-02-26 18:48:37.089 [Tunnel] Looking up host "16.142.123.226" for SSH connection
. 2021-02-26 18:48:37.089 [Tunnel] Connecting to 16.142.123.226 port 22
. 2021-02-26 18:48:37.195 [Tunnel] We claim version: SSH-2.0-WinSCP_release_5.17.10
. 2021-02-26 18:48:37.287 [Tunnel] Remote version: SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
. 2021-02-26 18:48:37.287 [Tunnel] Using SSH protocol version 2
. 2021-02-26 18:48:37.386 [Tunnel] Doing ECDH key exchange with curve Curve25519 and hash SHA-256
. 2021-02-26 18:48:37.555 [Tunnel] Server also has ecdsa-sha2-nistp256/ssh-rsa host keys, but we don't know any of them
. 2021-02-26 18:48:37.555 [Tunnel] Host key fingerprint is:
. 2021-02-26 18:48:37.555 [Tunnel] ssh-ed25519 255 5d:22:c3:fd:21:18:7c:e5:1e:89:74:a2:b2:a6:b7:b3 6111asdeQSwYxfhhcNsad3XVmgScclL2Smgf85ucQ=
. 2021-02-26 18:48:37.556 [Tunnel] Closing connection.