Instruction Name

Renomme un fichier ou répertoire existant.

Syntaxe :


Name OldName As String As NewName As String

Paramètres :

OldName, NewName : expression au format chaîne de caractères indiquant le nom de fichier, chemin d'accès compris. Vous pouvez également utiliser la notation URL.

Exemple :


Sub ExampleReName
On Error GoTo Error
FileCopy "c:\autoexec.bat", "c:\temp\autoexec.sav"
Name "c:\temp\autoexec.sav" As "c:\temp\autoexec.bat"
End
Error:
If err = 58 Then
    msgbox "Le fichier existe déjà"
End If
End
End Sub

Aidez-nous !