Tutorials Infos - Anleitungen - Hilfe - Dreamcodes
 

Ftp Download

Lädt eine FTP Datei herunter. Pfad und Dateiname werden als Parameter übergeben

Script:

@Echo Off
If Not %1'==' (Call :Main %*&Goto :EOF)
Echo Downloads a file via FTP.
Echo.
Echo %~n0 Hostname/[Pfad/]Dateiname [Zielort]
Echo.
Echo.
Echo %~n0 Unterstützt nur den anonymen Login
Echo.
(Goto :EOF)
:Main
SetLocal
Set FtpUser=anonymous
Set FtpPass=noone@nowhere.no
Set FtpScript=%TEMP%.\$TPGET0.TMP
For /F "Tokens=1* Delims=/" %%A In ("%1") Do (
Set Hostname=%%A&Set Filename=%%B)
If Not %2'==' (If Not Exist %2.\NUL MkDir %2&ChDir /D %2)
Echo user %FtpUser% %FtpPass%>%FtpScript%
Echo get %Filename%>>%FtpScript%
Echo bye>>%FtpScript%
%SystemRoot%\system32\FTP.EXE -n -s:%FtpScript% %Hostname%
Del %FtpScript%
EndLocal
(Goto :EOF)

 
ID: 678
eingestellt am: 05.02.2005
Autor: NA
Status zum lesen: Gast
gelesen: 7881
Webseite: www.dreamcodes.com
[Drucken]