Private Function RenameFile(ByVal OldFileNameWithPath As String, ByVal NewFileNameWithPath As String) As Boolean Try File.Move(OldFileNameWithPath, NewFileNameWithPath) Catch ex As Exception MsgBox("Renaming file not possible", MsgBoxStyle.Information Or MsgBoxStyle.Critical) End Try End Function
Private Function RenameFile(ByVal OldFileNameWithPath As String, ByVal NewFileNameWithPath As String) As Boolean Try File.Move(OldFileNameWithPath, NewFileNameWithPath) return true Catch ex As Exception err.clear return false End Try End Function
If RenameFile("C:\old.bat","C:\New.bat") = true then Msgbox("Succed") else MsgBox("Renaming file not possible", MsgBoxStyle.Information Or endif
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.