簡體   English   中英

移至ftp的子文件夾

[英]move to subfolder of ftp

嘗試直接連接到ftp的子文件夾失敗。

它顯示

未知主機ftp://ftp2.xxx.com/test/949010 需要幫助。謝謝

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%

如果要上傳的文件很多,則應使用mput *.* (多次放置)

這是您可以使用的命令列表

當然,請更改此行:

SET "Commands=%TEMP%SendToFTP_commands.txt"

對此:

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

我在子文件夾中包含以下內容

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM