FileCopy Procedure


FileCopy Procedure

Class

Microsoft.VisualBasic.FileSystem

Syntax

     FileCopy(source, destination) 


source (required; String)

The path of the file to be copied


destination (required; String)

The path and name of the new target file

Description

The FileCopy procedure copies an existing file to a new location, optionally giving the file a new name.

Usage at a Glance

  • The source and destination may contain absolute or relative paths, but they must always contain the old and new filenames. destination must include the filename; it cannot be the destination directory only.

  • You cannot copy a file that is currently open.

  • FileCopy raises errors on failure instead of returning an error code.

  • If the destination file already exists, it will be overwritten without warning.

Version Differences

Visual Basic 2005 includes a My.Computer.FileSystem.CopyFile method that provides similar functionality.

See Also

Rename Procedure




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net