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

martin

Re: How to write local path with spaces?

You have to use double double quotes:
   "put -delete ""C:\FTP\00474 - CUSTOMER NAME\DDT\ESPORTATI\*.*"" /OUT/PRODUZIONE/" ^

See https://winscp.net/eng/docs/commandline#syntax
massimo.z@cstv.it

How to write local path with spaces?

Hi, I need to write a bat file to transfer the files.
this is my local path:
C:\FTP\01428 - CUSTOMER NAME
And this is the code, but it doesn't work.
@echo off
 
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="C:\Magonet\Custom\FileBat\Log\WinSCP.log" /ini=nul ^
  /command ^
   "open ftp://username:password@ftp.site.it/" ^
   "put -delete C:\FTP\00474 - CUSTOMER NAME\DDT\ESPORTATI\*.* /OUT/PRODUZIONE/" ^
   "exit"
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
 
exit /b %WINSCP_RESULT%

How can I write it down correctly?
Thanks