The system cannot find the file specified

Advertisement

maximuss
Guest

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%

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

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\*.*"" /" ^

Reply with quote

Advertisement

You can post new topics in this forum