如何通过cmd,在FTP远程服务器上建立当前日期的文件夹 并打开它,上传本地文件

2024-11-17 01:39:56
推荐回答(1个)
回答1:

set "i=/httpdocs/"
set filesname=%date:~0,4%%date:~5,2%%date:~8,2%

@echo open IP>>ftpcmd.txt
@echo USER NAME>>ftpcmd.txt
@echo Password>>ftpcmd.txt
@echo binary>>ftpcmd.txt
@echo cd %i%>>ftpcmd.txt
@echo mkdir %filesname%>>ftpcmd.txt
@echo cd %filesname%>>ftpcmd.txt

@echo prompt>>ftpcmd.txt
@echo put file.txt>>ftpcmd.txt
@echo bye>>ftpcmd.txt

ftp -s:D:/ftpcmd.txt

pause > null