简体   繁体   中英

move to subfolder of ftp

unsuccessful trying to connect directly into subfolder of ftp.

it showing

unknown host ftp://ftp2.xxx.com/test/949010 . need help please.thanks

SET "Server=ftp://ftp2.xxx.com/test/949010"
SET "UserName=xxx"
SET "Password=x:nj*~A+"

SET "Commands=%TEMP%SendToFTP_commands.txt"

    ECHO %UserName%> %Commands%
    ECHO %Password%>> %Commands%
    ECHO binary >> %Commands%
    ECHO put "C:\Users\Desktop\Processed\*" >> %Commands%

    REM Close the FTP connection.
    ECHO close  >> %Commands%
    ECHO bye    >> %Commands%   


    REM Perform the FTP.
    FTP -d -i -s:%Commands% %Server%

    ECHO.
    ECHO.
    pause
    REM Clean up.
    IF EXIST %Commands% DEL %Commands%

You should use mput *.* (multiple put), if you have many files to upload

Here are a list of commands you can use.

And of course change this line :

SET "Commands=%TEMP%SendToFTP_commands.txt"

to this :

SET "Commands=%TEMP%\SendToFTP_commands.txt"

I include below to the subfolder

ECHO %UserName%> %Commands%
    ECHO %Password%>> %Commands%
    REM FTP subfolder of in/
    ECHO cd in/%%X>> %Commands%
    ECHO binary >> %Commands%

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM