R.A. Epigonos et al.

ftp接続を行い、ネットワーク上のディスクからメモファイルをコピー

ログイン時にホームディレクトリがカレントフォルダになるようなサーバーにおいて、~/memo/index.htmlがメモファイルだとすれば、以下のようなバッチファイルを作ることで、index.htmlをカレントフォルダにコピーできます。

rem --------------------------- set groval parametor
set R=za.toypark.in
set N=za
set P=password
set D=./memo
set M=index.html
rem --------------------------- set local parametor for get
set C=get
set F=ftp_get.txt
rem --------------------------- make get script
echo open %R%> %F%
echo %N%>> %F%
echo %P%>> %F%
echo ascii>> %F%
echo %C% %D%/%M%>> %F%
echo bye>> %F%
rem --------------------------- get a memo file
ftp -s:%F%
del %F%
rem --------------------------- make a memo.tmp
C:\temp_prog\xechov20\XECHO.COM $D$T$Lbr$G>> index.tmp
rem --------------------------- add a memo.tmp to memo file
copy /B index.html+index.tmp index.html
rem --------------------------- set local parametor for put
set C=put
set F=ftp_put.txt
rem --------------------------- make put script
echo open %R%> %F%
echo %N%>> %F%
echo %P%>> %F%
echo cd %D%>> %F%
echo ascii>> %F%
echo %C% %M%>> %F%
echo bye>> %F%
rem --------------------------- put a memo file
ftp -s:%F%
del %F%
rem --------------------------- irase tempraly files
del index.html
del index.tmp
exit

ソーシャルブックマーク

  1. はてなブックマーク
  2. Google Bookmarks
  3. del.icio.us

ChangeLog

  1. Posted: 2008-06-17T07:18:48+09:00
  2. Modified: 2008-06-17T06:31:37+09:00
  3. Generated: 2023-05-28T23:09:08+09:00