下記のようにすればバッチファイルでftpを実行可能です。
※ユーザID、パスワードが平文で残ってしまうことを気にするのであれば、パラメータ入力やキー入力して、ftpscript.txtを動的に生成するなどで対処は可能でしょう。
◆autoftp.bat
1 |
ftp -i -n -s:ftpscript.txt |
◆ftpscript.txt
1 2 3 4 5 6 7 8 |
open [ftpサーバ] user [user] [password] hash as mput *.html bi mput *.jpg bye |
→ ダウンロード
UNIX shell(bash)版もあります。
One comment
これは良く使ってました。
けど、
user [user] [password]
以降はサーバーサイドコマンドも使うので、
実際使う時はそちらも調べる必要がるでしょう。
※as、biを理解しないftp鯖もある。とか、そーゆー事ね。
By submitting a comment you grant typista a perpetual license to reproduce your words and name/web site in attribution. Inappropriate and irrelevant comments will be removed at an admin’s discretion. Your email is used for verification purposes only, it will never be shared.