Or, if you are copying to a location where the file aready exists, (using name here will raise an error), you can use:

VB Code:
  1. '==========================================
  2. 'for the value, bFailIfExists.  If you set this value to true, then
  3. 'the file won't be copied is the file already exists.  If this value
  4. 'is false, then the file will overwrite any existing copies of the
  5. 'file
  6. '===========================================
  7.  
  8. Private Declare Function CopyFile Lib "kernel32" Alias _
  9.                         "CopyFileA"  (ByVal lpExistingFileName As String, _
  10.                          ByVal lpNewFileName As String, _
  11.                          ByVal bFailIfExists As Long) As Long
  12.  
  13.  
  14. Private Command1_Click()
  15. Dim lret as long
  16.  
  17. '===========================================
  18. 'This will create a duplicate file, without deleting the original
  19. 'file.  And will overwrite the destination file, if it already exits.
  20. '===========================================
  21. lret=CopyFile("c:\windows\desktop\test.txt", "c:\windows\desktop\test1.txt", True)
  22.  
  23. End sub

Hope this helps.