Voilà un tout en un.
Modifications :
- un seul fichier batch
- transferts ftp dans le répertoire temporaire
- affiche un log uniquement en cas d'erreur ftp
- si on n'efface pas l'exe, il se retrouve dans le répertoire du batch
@echo off
set name=Firefox Setup 3.5.exe
echo -----------------------------------------------------------
echo Veuillez patienter pendant le telechargement du fichier !
echo -----------------------------------------------------------
echo OPEN 204.152.184.113 21>%temp%\firefox.ftp
echo. >>%temp%\firefox.ftp
echo USER anonymous anonymous>>%temp%\firefox.ftp
echo BINARY>>%temp%\firefox.ftp
echo LCD %temp%>>%temp%\firefox.ftp
echo CD /pub/mozilla.org/firefox/releases/3.5/win32/fr/>>%temp%\firefox.ftp
echo GET "%name%">>%temp%\firefox.ftp
echo CLOSE>>%temp%\firefox.ftp
echo bye>>%temp%\firefox.ftp
ftp -s:%temp%\firefox.ftp >%temp%\firefox.log 2>NUL
del %temp%\firefox.ftp>NUL
type %temp%\firefox.log | find /i "226 File send OK"
if errorlevel 1 (
cls
echo -----------------------------------------------------------
echo !! Erreur pendant le transfert FTP, voir fichier de log !!
echo -----------------------------------------------------------
notepad %temp%\firefox.log
del %temp%\firefox.log
exit
)
cls
echo -----------------------------------------------------------
echo Appuyer sur une touche pour installer Firefox
echo -----------------------------------------------------------
pause>NUL
"%temp%\%name%"
cls
echo -----------------------------------------------------------
echo Effacer le fichier d'installation (O/N)
echo -----------------------------------------------------------
set /p ERASE=
if /i "%ERASE%"=="n" (move "%temp%\%name%" .) else (del "%temp%\%name%")
del %temp%\firefox.log
exit