Yussi Ariefiyono
uploading the latest file to ftp with batch command
uploading the latest file to ftp, all you need 2 .bat files
fileup.bat
@echo off
echo user USERNAME> ftpcmd.dat
echo PASSWORD>> ftpcmd.dat
echo bin>> ftpcmd.dat
echo cd REMOTEPATH >> ftpcmd.dat
echo put %1>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat FTPADDRESS
del ftpcmd.dat
CALL.bat
@echo off
setlocal
:source directory
set srcDir=SOURCE DIRECTORY
set lastmod=
pushd “%srcDir%”
for /f “tokens=*” %%a in (‘dir /b /od 2^>NUL’) do set lastmod=%%a
if “%lastmod%”==”" echo Could not locate files.&goto :eof
:copy
call YOURPATH\fileup.bat “%lastmod%”
:delete
del “%lastmod%”
You call the CALL.bat, and the fileup.bat is for information
| Print article | This entry was posted by yussi ariefiyono on April 8, 2010 at 9:45 am, and is filed under batch command. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |