如何通过cmd,在FTP远程服务器上建立当前日期的文件夹 并打开它,上传本地文件
试了几次,都无法在服务器上创建以当天日期为名称的文件夹,该如何修改。请大仙们赐教。setYY=%date:~2,2%setMM=%date:~5,2%setDD=%dat...
试了几次,都无法在服务器上创建以当天日期为名称的文件夹,该如何修改。请大仙们赐教。
set YY=%date:~2,2%
set MM=%date:~5,2%
set DD=%date:~8,2%
echo open 192.0.0.0> getftp.txt
echo user name>> getftp.txt
echo password>> getftp.txt
echo lcd C:\DDD\BBB>> getftp.txt
echo get %YY%%MM%%DD%.lzh>> getftp.txt
echo close>> getftp.txt
echo bye>> getftp.txt
ftp -s:getftp.txt > %YY%%MM%%DD%
exit 展开
set YY=%date:~2,2%
set MM=%date:~5,2%
set DD=%date:~8,2%
echo open 192.0.0.0> getftp.txt
echo user name>> getftp.txt
echo password>> getftp.txt
echo lcd C:\DDD\BBB>> getftp.txt
echo get %YY%%MM%%DD%.lzh>> getftp.txt
echo close>> getftp.txt
echo bye>> getftp.txt
ftp -s:getftp.txt > %YY%%MM%%DD%
exit 展开
展开全部
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
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
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询