I have a batch file running and when it tries to upload the latest file, I am getting and error code 3, cannot overwrite remote file. I've attached the log file. There are tons of
.csvfile in my local directory but I just want to upload the latest file every morning, so I am using the
-latestswitch, is this accurate? Please help!
Here's my batch file:
@echo off "C:\Program Files (x86)\WinSCP\WinSCP.com" ^ /log="C:\bin\script\log\test.log" /ini=nul ^ /command ^ "open sftp://email@example.com/ -hostkey=""ssh-rsa 2048 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx="" -privatekey=""C:\temp\id-rsa.ppk"" -rawsettings ProxyPort=0" ^ "put -latest ""C:\Data\Shares\Accounting\Yardi Lockbox DNA\YardiDNALBTest\*"" /inbound/FRESN865_LBFRE_2" ^ "exit" ^ echo %ERRORLEVEL% set WINSCP_RESULT=%ERRORLEVEL% if %WINSCP_RESULT% equ 0 ( echo Success ) else ( echo Error ) exit /b %WINSCP_RESULT%