ftp的bat上传脚本。我本地电脑E盘中文件夹a的全部文件,上传至ftp服务器的根目录

2024-11-30 14:25:50
推荐回答(1个)
回答(1):

set SCRIPT_FILE=ftpScript.txt
set SERVER_ADDR=192.168.1.10
set USER=ftpadmin
set PASSWORD=ftppass123

echo open %SERVER_ADDR% > %SCRIPT_FILE%
echo %USER% >> %SCRIPT_FILE%
echo %PASSWORD% >> %SCRIPT_FILE%
for /f %%i in ('dir /s D:') do (
echo put %%i >> %SCRIPT_FILE%
)
echo quit >> %SCRIPT_FILE%

ftp -s:%SCRIPT_FILE%
pause

保存成bat文件,找个putty试试