‘File.Copy’ does not overwrite a file

Use

File.Copy(filePath, newPath, true);

The third parameter is overwrite, so if you set it to true the destination file will be overwritten.

See: File.Copy in the MSDN

Leave a Comment