Post a reply

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

maximuss

Solved!

That solved my problem, I can't believe I missed that :D
Thank you for your help!
martin

Re: The system cannot find the file specified

Windows paths use forward slash, not backslash:
"put ""d:\Google Drive\Visual Studio\Project\FS2FS\WebAPI\Publish\*.*"" /" ^
maximuss

The system cannot find the file specified

Hi,

I'm trying to automate some FTP upload to my server. So far i can connect and it seems that WinSCP also count the files in the source directory, but when it starts to upload i get this error in the log:
File or folder 'd:API.deps.json' does not exist.
System Error. Code: 2.

The file "API.deps.json" do exists, but ofc. not in "d:API.deps.json" but in the directory that i have specified in the script below - i have double checked.

This is my script:
@echo off


"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="d:\Google Drive\Visual Studio\Project\FS2FS\WebAPI\WinScpLog\WinSCP.log" /ini=nul ^
  /command ^
    "open ftp://[Server_Info]/ -rawsettings ProxyPort=0" ^
    "put ""d:/Google Drive/Visual Studio/Project/FS2FS/WebAPI/Publish/*.*"" /" ^
    "exit"

set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)

exit /b %WINSCP_RESULT%