Re: Manual transfer fine but script not working
Ah I can't believe it! So simple. Thanks Martin
@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%
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>