Utilisation du SHELL FTP.exe

infomedacide Messages postés 1 Date d'inscription samedi 22 avril 2006 Statut Membre Dernière intervention 16 mai 2008 - 16 mai 2008 à 04:40
cs_VVV Messages postés 40 Date d'inscription mercredi 1 janvier 2003 Statut Membre Dernière intervention 15 juin 2009 - 15 juin 2009 à 09:20
Bonjour,
Avec la ligne suivante dans mon code, j'aimerais savoir comment je peux récupérer les divers messages provenant du serveur FTP pour pouvoir les enrégistrer dans un fichier texte?

retvale = Shell("ftp.exe -s:C:\FTP.txt", vbHide)

Exemple:
230 Logged on
257 "/" is current directory.
200 Type set to I
Bla bla bla....

Merci!

7 réponses

Renfield Messages postés 17287 Date d'inscription mercredi 2 janvier 2002 Statut Modérateur Dernière intervention 27 septembre 2021 74
16 mai 2008 à 05:57
B.A.BA du dos :

ftp.exe -s:C:\FTP.txt > C:\Log.txt
0
infodemers Messages postés 4 Date d'inscription mardi 11 octobre 2005 Statut Membre Dernière intervention 19 avril 2010
20 mai 2008 à 05:09
Bonjour,

C'est gentil de vouloir aider mais cela ne fonctionne pas, j'obtiens un "invalid command"

Merci!

InfoDemers
Développeur d'Application Web
0
Renfield Messages postés 17287 Date d'inscription mercredi 2 janvier 2002 Statut Modérateur Dernière intervention 27 septembre 2021 74
20 mai 2008 à 06:29
euh.... tu as pas mis la ligne de commande DOS dans ton code VB6, si ?

je sous-entendais :

Shell "ftp.exe -s:C:\FTP.txt > C:\Log.txt", vbHide

ton code, quoi, mais en montrant juste le > qui nous importe ici
0
infodemers Messages postés 4 Date d'inscription mardi 11 octobre 2005 Statut Membre Dernière intervention 19 avril 2010
21 mai 2008 à 04:33
Bonjour Renfield,

Finalement, j'ai opté pour l'option suivante:

retvale = Shell(

"c:\batch_files\ftp.bat") 'Exécute un batch file

'Contenu du batch file.

echo Start of download > c:\batch_files\[file://d7ncwx/c$/SAR-NPS/STAS/batch_files/ftp.log ftp.log]
echo ********************************* > [file://d7ncwx/c$/SAR-NPS/STAS/batch_files/ftp.log c:\batch_files\ftp.log]
echo *              Stas Pallus                                * > c:\batch_files\[file://d7ncwx/c$/SAR-NPS/STAS/batch_files/ftp.log ftp.log]
echo *                                                              * > c:\batch_files\[file://d7ncwx/c$/SAR-NPS/STAS/batch_files/ftp.log ftp.log]
echo * For any questions - Pour toute question  * > c:\batch_files\[file://d7ncwx/c$/SAR-NPS/STAS/batch_files/ftp.log ftp.log]
echo *             Merci-Thanks                            * > c:\batch_files\[file://d7ncwx/c$/SAR-NPS/STAS/batch_files/ftp.log ftp.log]
echo *       ©2008 Groupe SAR-NPS Group    * > c:\batch_files\[file://d7ncwx/c$/SAR-NPS/STAS/batch_files/ftp.log ftp.log]
echo ********************************** > [file://d7ncwx/c$/SAR-NPS/STAS/batch_files/ftp.log c:\batch_files\ftp.log]
ftp.exe -s:c:\batch_files\FTPGetList.txt >> [file://d7ncwx/c$/SAR-NPS/STAS/batch_files/ftp.log c:\batch_files\ftp.log]
echo End of download >> c:\batch_files\[file://d7ncwx/c$/SAR-NPS/STAS/batch_files/ftp.log ftp.log]
exit

Voilà!

InfoDemers
Développeur d'Application Web
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
cs_VVV Messages postés 40 Date d'inscription mercredi 1 janvier 2003 Statut Membre Dernière intervention 15 juin 2009
12 juin 2009 à 17:00
Question stupide sans doute...
Comment peut-on envoyer le fichier ailleurs qu'à la racine (ftp.exe -s:C:\FTP.txt) ?

J'avais pensé logiquement à ftp.exe -s:C:\tmp\FTP.txt
mais cela semble ne pas fonctionner !

Le problème est que sous Vista il n'y a pas moyen de créer un fichier à la racine du lecteur c:\

Une idée ?







V3
0
Renfield Messages postés 17287 Date d'inscription mercredi 2 janvier 2002 Statut Modérateur Dernière intervention 27 septembre 2021 74
15 juin 2009 à 09:07
tentes de mettre des guillemets :

ftp -s:"C:\Mon fichier\se trouve\là.txt"
0
cs_VVV Messages postés 40 Date d'inscription mercredi 1 janvier 2003 Statut Membre Dernière intervention 15 juin 2009
15 juin 2009 à 09:20
L'idée me semble bonne effectivement !
Merci... je vais tester ça :-)
0
Rejoignez-nous