Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Guest

That was it.. Thx Martin! something so simple and overlooked.
martin

Re: Getting error code: 3 permission denied in log file

You are missing a slash at the end of the target directory path:
    "put -latest ""C:\...\YardiDNALBTest\*"" /inbound/FRESN865_LBFRE_2/" ^

See https://winscp.net/eng/docs/scriptcommand_put#target
bumz

I dont want to overwrite the current files on the remote server, just upload latest file from my local directory to it.
bumz

Getting error code: 3 permission denied in log file

Hello,
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 .csv file in my local directory but I just want to upload the latest file every morning, so I am using the -latest switch, 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://xxxxxx@domain.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%