WinSCP Version 6.5.1 (Build 16311)

Batch file

@echo off

"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="C:\batch\target\WinSCP.log" /ini=nul /loglevel=1 ^

  /command ^
    "open 
    "lcd C:\batch\local" ^
    "get cg00.cg4163e8.xf00.20250605.004251" ^
    "exit"

set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)

exit /b %WINSCP_RESULT%


===========================================
Log file results excerpt (Debug level 1)

< 2025-06-05 10:30:08.738 Script: Authenticating...
. 2025-06-05 10:30:08.738 Host key matches configured key fingerprint
. 2025-06-05 10:30:08.738 Initialised AES-256 SDCTR (AES-NI accelerated) [aes256-ctr] outbound encryption
. 2025-06-05 10:30:08.738 Initialised HMAC-SHA-256 outbound MAC algorithm
. 2025-06-05 10:30:08.738 Initialised AES-256 SDCTR (AES-NI accelerated) [aes256-ctr] inbound encryption
. 2025-06-05 10:30:08.738 Initialised HMAC-SHA-256 inbound MAC algorithm
. 2025-06-05 10:30:08.782 Detected network event
. 2025-06-05 10:30:08.782 Waiting for the server to continue with the initialization
. 2025-06-05 10:30:08.782 Reading key file "C:\temp\xxxxxxxxxxxxxx.ppk"
! 2025-06-05 10:30:08.787 Using username "yyyyyyyyy".
< 2025-06-05 10:30:08.787 Script: Using username "yyyyyyyyy".
. 2025-06-05 10:30:08.860 Detected network event
. 2025-06-05 10:30:08.860 Waiting for the server to continue with the initialization
. 2025-06-05 10:30:08.860 Server offered these authentication methods: publickey,password
. 2025-06-05 10:30:08.860 Offered public key
. 2025-06-05 10:30:08.976 Detected network event
. 2025-06-05 10:30:08.976 Waiting for the server to continue with the initialization
. 2025-06-05 10:30:08.976 Offer of public key accepted
! 2025-06-05 10:30:08.976 Authenticating with public key "ss\acct@computername"
< 2025-06-05 10:30:08.977 Script: Authenticating with public key "ss\acct@computername".
. 2025-06-05 10:30:08.977 Prompt (passphrase, "SSH key passphrase", <no instructions>, "Passphrase for key "ss\acct@computername": ")
. 2025-06-05 10:30:08.978 Using configured passphrase.
. 2025-06-05 10:30:09.989 Sent public key signature
. 2025-06-05 10:30:10.034 Detected network event
. 2025-06-05 10:30:10.035 Waiting for the server to continue with the initialization
. 2025-06-05 10:30:10.035 Access granted
. 2025-06-05 10:30:10.036 Opening main session channel
. 2025-06-05 10:30:10.084 Detected network event
. 2025-06-05 10:30:10.084 Waiting for the server to continue with the initialization
. 2025-06-05 10:30:10.084 Opened main channel
. 2025-06-05 10:30:10.347 Detected network event
. 2025-06-05 10:30:10.347 Waiting for the server to continue with the initialization
. 2025-06-05 10:30:10.347 Started a shell/command
< 2025-06-05 10:30:10.347 Script: Authenticated.
. 2025-06-05 10:30:10.348 --------------------------------------------------------------------------
. 2025-06-05 10:30:10.348 Using SFTP protocol.
. 2025-06-05 10:30:10.348 Doing startup conversation with host.
< 2025-06-05 10:30:10.348 Script: Starting the session...
. 2025-06-05 10:30:10.348 Not well known server, limiting to safe SFTP version 3.
> 2025-06-05 10:30:10.348 Type: SSH_FXP_INIT, Size: 5, Number: -1
. 2025-06-05 10:30:10.349 Sent 9 bytes
. 2025-06-05 10:30:10.349 There are 0 bytes remaining in the send buffer
. 2025-06-05 10:30:10.349 Waiting for another 4 bytes
. 2025-06-05 10:30:10.392 Detected network event
. 2025-06-05 10:30:10.392 Waiting for another 4 bytes
. 2025-06-05 10:30:10.392 Received 110 bytes
. 2025-06-05 10:30:10.392 Read 4 bytes (106 pending)
. 2025-06-05 10:30:10.393 Read 106 bytes (0 pending)
< 2025-06-05 10:30:10.393 Type: SSH_FXP_VERSION, Size: 106, Number: -1
. 2025-06-05 10:30:10.393 SFTP version 3 negotiated.
. 2025-06-05 10:30:10.393 Unknown server extension newline@vandyke.com="\n"
. 2025-06-05 10:30:10.393 Server software: Maverick SSHD 1.7.58 (0) by JADAPTIVE Limited
. 2025-06-05 10:30:10.393 We believe the server has signed timestamps bug
. 2025-06-05 10:30:10.393 We will use UTF-8 strings until server sends an invalid UTF-8 string as with SFTP version 3 and older UTF-8 strings are not mandatory
> 2025-06-05 10:30:10.393 Type: SSH_FXP_EXTENDED, Size: 63, Number: 200
. 2025-06-05 10:30:10.393 Sent 67 bytes
. 2025-06-05 10:30:10.393 There are 0 bytes remaining in the send buffer
. 2025-06-05 10:30:10.393 Getting current directory name.
. 2025-06-05 10:30:10.393 Getting real path for '.'
> 2025-06-05 10:30:10.393 Type: SSH_FXP_REALPATH, Size: 10, Number: 272
. 2025-06-05 10:30:10.393 Sent 14 bytes
. 2025-06-05 10:30:10.393 There are 0 bytes remaining in the send buffer
. 2025-06-05 10:30:10.393 Waiting for another 4 bytes
. 2025-06-05 10:30:10.475 Detected network event
. 2025-06-05 10:30:10.476 Waiting for another 4 bytes
. 2025-06-05 10:30:10.476 Received 68 bytes
. 2025-06-05 10:30:10.476 Read 4 bytes (64 pending)
. 2025-06-05 10:30:10.476 Read 64 bytes (0 pending)
< 2025-06-05 10:30:10.476 Type: SSH_FXP_STATUS, Size: 64, Number: 200
. 2025-06-05 10:30:10.476 Discarding reserved response
. 2025-06-05 10:30:10.476 Waiting for another 4 bytes
. 2025-06-05 10:30:10.481 Detected network event
. 2025-06-05 10:30:10.481 Waiting for another 4 bytes
. 2025-06-05 10:30:10.481 Received 55 bytes
. 2025-06-05 10:30:10.481 Read 4 bytes (51 pending)
. 2025-06-05 10:30:10.481 Read 51 bytes (0 pending)
< 2025-06-05 10:30:10.482 Type: SSH_FXP_NAME, Size: 51, Number: 272
. 2025-06-05 10:30:10.482 Real path is '/'
. 2025-06-05 10:30:10.482 Startup conversation with host finished.
< 2025-06-05 10:30:10.482 Script: Session started.
< 2025-06-05 10:30:10.493 Script: Active session: [1] yyyyyyyyy@filegateway.target.com
. 2025-06-05 10:30:10.493 Session upkeep
. 2025-06-05 10:30:10.494 Script: Exit code: 1
. 2025-06-05 10:30:10.494 Script: Max roundtrip: 10109
. 2025-06-05 10:30:10.494 Closing connection.
. 2025-06-05 10:30:10.494 Sending special code: 1
. 2025-06-05 10:30:10.538 Detected network event
. 2025-06-05 10:30:10.538 Session sent command exit status 0
. 2025-06-05 10:30:10.538 Detected network event
. 2025-06-05 10:30:10.538 Main session channel closed
. 2025-06-05 10:30:10.538 All channels closed
