In this code we are using ‘Name’ statement for renaming file using vb 6.0
Sub RenameFile() Dim strName As String Dim strNewName As String strName = "c:\text.txt" strNewName = "c:\hello.txt" Name sOldPathName As strNewName End Sub
This code will be change the name of the file text.txt to hello.txt.