è meglio non instanziare l' oggetto ed usare l'oggetto(FileSystem):
Kill percorso
FileCopy percorso_S,percorso_D
'per rinominarlo:
Function RenamePath(Sorgente, Destinazione) As Boolean
On Error Resume Next
Dim p_S, p_D As String
p_S = Sorgente
p_D = Destinazione
FileCopy p_S, p_D
Kill p_S
If Err.Number > 0 Then
RenamePath = 0
Else
RenamePath = 1
End If
End Function

Rispondi quotando