將UP_SOURCE路徑的所有UP_SUBNAME副檔名的檔案複製到桌面。登入FTP,並把剛才複製的檔案(桌面上)上傳到UP_TARGETDIR指定的目錄。
程式內容如下:
@ECHO OFF
REM ———— Variable Name ———————————
set UP_USERNAME=youruser
set UP_PASSWORD=yourpass
set UP_SERVER_IP=123.123.123.123
set UP_SOURCE=”.\local\path\”
set UP_SUBNAME=”*.sol”
set UP_TARGETDIR=”./”
REM ———— Start Progress ———————————
copy %UP_SOURCE%%UP_SUBNAME%
echo %UP_USERNAME%>> ftp.txt
echo %UP_PASSWORD%>> ftp.txt
echo cd %UP_TARGETDIR%>> ftp.txt
FOR %%X IN (%UP_SUBNAME%) DO (echo put %%X>>ftp.txt)
echo bye>> ftp.txt
ftp -s:ftp.txt %UP_SERVER_IP%
del ftp.txt
pause
沒有留言:
張貼留言