Private Declare Function MoveFile Lib "kernel32.dll" Alias "MoveFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String) As Long Private Sub Form_Load() Dim retval As Long ' return value retval = MoveFile("D:\showagent.txt", "D:\showagent1.txt") If retval = 0 Then MsgBox "File not found" Else MsgBox "File Move successful" End If End End Sub