File.Copy
Description
- Makes a copy of a file to the specified path.
Syntax
- File.Copy(source, destination)
Parameters
- source
- (string) full path to the file to be copied
- destination
- (string) path to the destination file
- If file name not included in path, source file name is used.
Examples
- File.Copy(?"c:\mypath\in.txt", ?"c:\output\out.txt")
- Copies "c:\mypath\in.txt" to "c:\output\out.txt".
- File.Copy(?"c:\docs\*.txt", ?"c:\backup\")
- Use the "*" wildcard to that specify all text files in "c:\docs" are to be copied to "c:\backup".
- File.Copy(?"c:\mydocs\file?.txt", ?"c:\logs")
- Uses the "?" wildcard to specify that all text files with a file name consisting of the word "file" plus one more character & the extension should be copied to folder "c:\logs".