Sub CmdDos()
Dim laChaine As String, x, fichier As String, tim#
fichier = Environ("userprofile") & "\DeskTop\list.txt"
racine = "H:\"
tim = Timer
' Exécute la commande DOS Dir .
Shell "C:\Windows\System32\cmd.exe /C dir " & racine & " /S /b /A:-D >""" & fichier & """, vbHide"
x = FreeFile: Open fichier For Binary Access Read As #x: laChaine = String(LOF(x), " "): Get #x, , laChaine: Close #x
tbl = Split(laChaine, vbCrLf)
arr1 = Array("a~", "a'", "a`", "a^", "a¨", "e`", "e^", "e¨", "i`", "i^", "i¨", "o~", "o`", "o^", "o¨", "u`", "u^", "u¨") 'array caracteres séparés
arr2 = Array("ã", "à", "à", "â", "ä", "è", "ê", "ë", "ì", "î", "ï", "õ", "ò", "ô", "ö", "ù", "û", "ü") 'array caracteres regroupés
For i = LBound(tbl) To UBound(tbl)
x = InStr(1, tbl(i), ",")
'If x > 0 Then If Mid(tbl(i), x - 1, 1) <> " " Then Mid(tbl(i), x, 1) = "é"'pas bon
For C = LBound(arr1) To UBound(arr1)
If InStr(1, tbl(i), arr1(C)) > 0 Then tbl(i) = Replace(tbl(i), arr1(C), arr2(C))
Next C
Next i
MsgBox Timer - tim & " secondes pour " & UBound(tbl) & " fichiers"
[A1].Resize(UBound(tbl), 1) = Application.Transpose(tbl)
'Kill fichier
End Sub