Executer 1 Commande DOS fichier par fichier

Fermé
Koshin - 3 sept. 2004 à 20:18
Kobaya Messages postés 282 Date d'inscription vendredi 28 mai 2004 Statut Membre Dernière intervention 10 janvier 2008 - 6 sept. 2004 à 12:16


Comment executer une commande DOS de type "copy" ou "move" sur plusieurs fichiers en traitant un fichier à la fois, entrecoupés de pauses?

Merci par avance

Koshin
A voir également:

1 réponse

Kobaya Messages postés 282 Date d'inscription vendredi 28 mai 2004 Statut Membre Dernière intervention 10 janvier 2008 214
6 sept. 2004 à 12:16
Salut,

Essaye ça :
Sub Test()
Dim strFic As String

strFic = Dir("C:\temp\*.*")
Do
If strFic <> "" Then
Debug.Print strFic
FileCopy "C:\temp\" & strFic, "D:\temp\" & strFic
MsgBox strFic & " copié dans D:\Temp\"
End If
strFic = Dir()
Loop Until strFic = ""
End Sub

A+.
0