FILE

Top  Previous  Next

Syntax:

 

FILE COPY, <file path 1>, <file path 2> {, ALLOWUNDO, CONFIRM, SHOWERRORS }

FILE DELETE, <file path> {, ALLOWUNDO, CONFIRM, SHOWERRORS }

FILE RENAME, <file path 1>, <file path 2> {, ALLOWUNDO, CONFIRM, SHOWERRORS }

FILE SETDATE, <file path>, <time>, <date>

FILE SETATTR, <file path>, <attributes>

 

Description:

 

The FILE command is used to perform operations on files.

FILE COPY copies the file named in <file path 1> to <file path 2>. The original date and time are preserved. If no directory is specified for the target file, the file is copied to the current directory.

FILE DELETE deletes the file named in <file path>.

FILE RENAME renames the file named in <file path 1> to <file path 2>. A file can be renamed from one directory to another (in other words, moved) only if both directories reside on the same logical drive.

These three commands support additional options that allow applications to offer some protection against inadvertently deleting files. ALLOWUNDO deletes the directory to the Recycle Bin, so it can be undeleted later if required. (However. the file path must be a full path, or this option is ignored.) CONFIRM causes a dialog to be displayed requesting confirmation of the action. If SHOWERRORS is specified, a warning message is displayed if the operation cannot be completed. These commands also permit the use of wildcards.

In the COPY command, the first filename parameter can be a list of filenames separated by line feed characters, such as might be obtained from a string list using the @text function. The destination path may be a folder.

[VDS6] In the COPY command, <file path 1> may be an HTTP URL specifying a file on a web server.

FILE SETDATE changes the time and optionally the date of the file <file path>. The <time> and <date> should be expressed in the short time and short date styles set in the Windows control panel.

FILE SETATTR changes the attributes of the file <file path>. The string <attributes> is made up of characters which have the folowing meaning:

+

turns on the attributes that follow (default)

-

turns off the attributes that follow

A

archive attribute

H

hidden attribute

R

read-only attribute

S

system attribute

 

OK:

 

Set to false if the operation fails.

 

Example:

 

FILE DELETE,TEST.TXT

FILE COPY A:TEST.TXT, C:\TEMP

FILE SETDATE,VDS.HLP,2:00,1/3/2005

FILE SETATTR,C:.SYS,-SRH

 

See also: