FILECOPY statement

Purpose

Copy a file.

Syntax

FILECOPY sourcefile, destfile

Remarks

Copy the file sourcefile to the file destfile.  Both sourcefile and destfile must be filenames, not merely drives or directories (although it's OK to include drive and directory specifications along with the filenames).  Wildcards are not supported.  If you attempt to copy a file that is read locked (preventing read access), a run-time Error 70 will occur ("Permission denied").

If the destination file already exists, it will be overwritten.  If it is not possible to overwrite the existing destination file (for example, it is marked as read-only or in use by another program), the result will be a run-time Error  70 ("Permission denied").

The attributes of the source file are inherited by the destination file, with the exception of the Archive attribute, which is always set ON for the destination file.  File attributes may be examined or modified with the GETATTR and SETATTR statements.

See also

FILEATTR, GETATTR, SETATTR

Example

FILECOPY "C:\AUTOEXEC.BAT", "C:\AUTOEXEC.BAK"