下記のようにすればバッチファイルでftpを実行可能です。
※ユーザID、パスワードが平文で残ってしまうことを気にするのであれば、
パラメータ入力やキー入力して、ftpscript.txtを動的に生成するなどで
対処は可能でしょう。
◆autoftp.bat
ftp -i -n -s:ftpscript.txt
◆ftpscript.txt
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.