Manual transfer fine but script not working

Advertisement

jan_van_man
Joined:
Posts:
4

Manual transfer fine but script not working

Hi,

I have quite a few scripts that follow this batch script syntax and format and they all work fine. There is one that isn't working (different SFTP location) when using a script but when using the GUI, I'm able to download files from the SFTP.

The script is
@echo off
 
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="C:\FTP\WinSCP.log" /ini=nul /loglevel=2* ^
  /command ^
    "open sftp://UserName:Password@sftp.clientname.co.za/ -hostkey=""ssh-rsa 1024 7UI9GKZvOKnqKO3K21hvtyx4a8s2gxH7D8RrNeWJN38="" -rawsettings FSProtocol=2 ProxyPort=0" ^   
    "cd /" ^
    "lcd C:\FTP\Files\ClientName" ^
    "synchronize local -filemask=*.*>1DS" ^
    "exit"
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
 
exit /b %WINSCP_RESULT%
When I try running this I get this and then it sticks:
Searching for host...
Connecting to host...
Authenticating...
Using username "UserName".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Session started.
Active session: [1] UserName@sftp.ClientName.co.za
winscp>
I've attached the log results
  • LogResults.txt (16.25 KB, Private file)

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum