VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Copy a file using CopyFile API

by Karthikeyan (187 Submissions)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 15th December 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Copy a file using CopyFile API

Rate Copy a file using CopyFile API



Dim retval As Long  ' return value
' copy the file
retval = CopyFile("D:\sample.txt", "D:\example.txt", 1)
If retval = 0 Then  ' failure
MsgBox "Copy failed -- D:\example.txt already exists."
Else  ' success
MsgBox "Copy succeeded."
End If
End
End Sub

Download this snippet    Add to My Saved Code

Copy a file using CopyFile API Comments

No comments have been posted about Copy a file using CopyFile API. Why not be the first to post a comment about Copy a file using CopyFile API.

Post your comment

Subject:
Message:
0/1000 characters