Executer 1 Commande DOS fichier par fichier

Koshin -  
Kobaya Messages postés 282 Date d'inscription   Statut Membre Dernière intervention   -


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   Statut Membre Dernière intervention   214
 
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