FileCopyAttr

Copies files, and sets file attributes..

Syntax:

FileCopyAttr (source-list, destination, warning, attributes)

Parameters:

(s) source-list a string containing one or more filenames, which may be wildcarded.

(s) destination target path and/or file name/wildcard.

(i) warning @TRUE if you want a warning before overwriting existing files; @FALSE if no warning desired.

(s) attributes attributes to be modified

Returns:

(i) @TRUE if all files were copied successfully (see below).

 

Note: If warning parameter is set to @TRUE , then the return value will be @TRUE, even if it was modified by the user dialog.

Use this function to copy an individual file, a group of files using wildcards, or several groups of files by separating the names with a delimiter.

You can also copy files to any COM or LPT device, but do not place a colon after the name of the device.

Source-list and destination may contain * and ? wildcards.

attribute: The attribute string consists of one or more of the following characters (an upper case letter turns the specified attribute ON, a lower case letter turns it OFF):

Symbol Meaning

Symbol Meaning

R read only ON
A archive ON
S system ON
H hidden ON

r read only OFF
a archive OFF
s system OFF
h hidden OFF

 

Windows Vista/2008 and newer: This function may require an Administrator level account if dealing with files located in a protected directories: 'Program Files' and 'Windows'.

Examples:
temp=Environment("TEMP")
DirChange(DirWindows(0))
FileCopyAttr("*.ini", temp, @TRUE,"R")
Message("FileCopy","files backed up with Read-Only attribute set")
See Also:

IntControl 39, FileCopy, FileMoveAttr