Copie de plusieurs fichiers par FileCopy

fred - 15 nov. 2001 à 00:04
cs_DAN Messages postés 20 Date d'inscription mardi 29 janvier 2002 Statut Membre Dernière intervention 5 juillet 2003 - 14 mars 2002 à 03:45
Comment peut-on par la commande FileCopy copier tous les fichiers d'un
meme repertoire dans 1 autre repertoire:
FileSource =" C:\Image\*.* ds dos mais en vb? " (si fichier a,b,c et d dans Image)
FileDestination= "C:\Programme"
FileCopy FileSource FileDestination
Merci!!!!!!

4 réponses

configuration
15 nov. 2001 à 02:03
tu mets une fileBox sur ta form (ke tu peux cacher si tu veux)

tu fais
dim Chemin as string
FileBox.Path = ReprtoireSource
if right$(filebox.path,1)<>"" then
Chemin = filebox.path & ""
else
Chemin = filebox.path
end if
for i=0 to FileBox.ListCount -1
filecopy Chemin & filebox.list(i) RepertoireDestination & filebox.list(i)

et voilà !
de rien
0
J'ai essayé ton code:

If Right$(FileBox.Path, 1) <> "" Then
cheminS = FileBox.Path & ""
Else
cheminS = FileBox.Path
End If
cheminD = TEMP
For i = 0 To FileBox.ListCount - 1
FileCopy cheminS & filebox.list(i) cheminD & filebox.list(i)
ChDir TEMP
Shell TEMP & "tifo.bat", 1

TEMP est la variable qui stocke le chemin du repertoire
de destination
OR ce code plante sur la ligne FilaCOpy cheminS... erreur de
synthaxe????????
0
cs_DAN Messages postés 20 Date d'inscription mardi 29 janvier 2002 Statut Membre Dernière intervention 5 juillet 2003
22 févr. 2002 à 03:39
:) Voici la maniere de filecopy pour plusieure fichier :)

Dim Chemin As String
filebox.Path =  "C:\ton repertoire  source"
If Right$(filebox.Path, 1) <> "" Then
Chemin = filebox.Path & ""
Else
Chemin = filebox.Path
End If
For i = 0 To filebox.ListCount - 1
FileCopy Chemin & filebox.List(i), "C:\ton  repertoire  destination" & filebox.List(i)
Next i


tu met un filebox avec nom: filebox
moi ca marche tres bien chex moi
looooooooooooooooooooooooool

8-) DAN
8-)
0
cs_DAN Messages postés 20 Date d'inscription mardi 29 janvier 2002 Statut Membre Dernière intervention 5 juillet 2003
14 mars 2002 à 03:45
la meme procedure que d'abitude
tu mets une fileBox sur ta form (ke tu peux cacher si tu veux)

source:

Dim Chemin As String
filebox.Path = "C:\ton repertoire source"
If Right$(filebox.Path, 1) <> "" Then Chemin = filebox.Path & ""
Else
Chemin = filebox.Path
End If
For i = 0 To filebox.ListCount - 1
FileCopy Chemin & filebox.List(i), "C:\ton repertoir de destination" & filebox.List(i)
Next i

DAN
0
Rejoignez-nous