Set Attributes Action Icon

Set Attributes

Declaration

<AMSETATTRIBUTES SOURCE="text" SUBFOLDERS="yes/no" ISNEWERTHAN="date" ISOLDERTHAN="date" ATTRIBUTES="text (+/-RASH combination)" ATTRFILTER="text (+/-RASH combination)" EXCLUDE="text" RESULTDATASET="text" />

Example

Example 1: Set Attributes for file(s) "c:\myfile.txt". System on.

<AMSETATTRIBUTES SOURCE="c:\myfile.txt" ATTRIBUTES="+s" />

Example 2: Set Attributes for file(s) "C:\SourceFolder\*.*". Exclude the file mask(s) "*.pri". Archive on. Include sub folders. Only if older than "2/26/2007 11:41:46 PM". Only if system is not set. Only if hidden is not set. Create and populate dataset "SetAttrDataset" with query results.

<AMSETATTRIBUTES SOURCE="C:\SourceFolder\*.*" SUBFOLDERS="YES" ISOLDERTHAN="%DateSerial(2007,02,26) + TimeSerial(23,41,46)%" ATTRIBUTES="+a" ATTRFILTER="-s-h" EXCLUDE="*.pri" RESULTDATASET="SetAttrDataset" />

See Also

Split File, Join File, Move File, Create Folder, Delete File, Delete Folder, Rename Folder, Remove Folder, Touch File, Set Attributes, Read from File, Write to File, Synchronize Folders, Concatenate Files, Calculate File Checksum, About Datasets

Sets the attributes of one or more files specified. To specify more than one file, use wildcards (Example: * or ?). Used to set the attributes of one or more files. More on RASH File Attributes.

General Tab

Property

Type

Required

Default

Markup

Description

Source

Text

Yes

(Empty)

a)SOURCE="c:\sourcefolder\file.txt"

b)SOURCE="c:\sourcefolder\*.txt"

c)SOURCE="file.txt"

The files that should be affected by the attribute change. This can be a fully qualified path and file name (preferred) or a file name only (requires use of the Change Folder action). Wildcard characters (* or ?) may be used to specify files matching a certain mask. ).

Attributes

Options

Yes

(Empty)

a)ATTRIBUTES="+A+H" (archive, hidden attrib on)

b)ATTRIBUTES="-S-H" (system, hidden attrib off)

c)ATTRIBUTES="-R-A+S+H" (read-only and archive attrib off, system & hidden attrib on)

The attribute combination that the files should be modified to. In Visual mode select from the drop-down lists. In AML mode, use the RASH attribute system as outlined below.

Create and Populate Dataset

Text

No

(Empty)

RESULTDATASET="DatasetName"

The name of a dataset to be created and populated with the results of this operation. More about datasets

Options Tab

Property

Type

Required

Default

Markup

Description

Include Subfolders

Yes/No

No

No

SUBFOLDERS="YES"

If set to YES, denotes that, if present, subfolders should be searched for files matching the mask specified in the Source parameter. If set to NO (default value), subfolders are altogether ignored.

Exclude Mask

Text

No

(Empty)

EXCLUDE="*.txt"

Causes this action to omit files matching the mask(s) specified. File names or wildcard masks may be used.

Only if Newer Than

Date

No

(Empty)

ISNEWERTHAN=

"%DateSerial(2001,10,12) + TimeSerial(00,00,00)%"

If enabled, causes this action to only act on files that are newer than the date/time specified. If this parameter is left blank or disabled (default), file dates are ignored.

Click Custom to select from a list of pre-defined date parameters. Enable the Expression option to allow entry of a date/time expression.

Only if Older Than

Date

No

(Empty)

ISOLDERTHAN=

"%DateSerial(2001,10,12) + TimeSerial(00,00,00)%"

If enabled, causes this action to only act on files that are older than the date/time specified. If this parameter is left blank or disabled (default), file dates are ignored.

Click Custom to select from a list of pre-defined date parameters. Enable the Expression option to allow entry of a date/time expression.

Attributes Tab

Property

Type

Required

Default

Markup

Description

Attributes

Text (Options)

No

(Empty)

ATTRFILTER="+R+A-H" (copy read-only & archive files but not hidden files)

This group of settings causes the action to filter which files are copied based on the attribute settings of the source file(s). In visual mode, a group of controls are provided to assist in the selection of this parameter. In markup mode, a single text item must be specified that contains the attributes of the files you want to act on.

Available Options:

  • R— Read-only: Specifying "+R" causes files with this attribute turned on to be included, "-R" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • A— Archive: Specifying "+A" causes files with this attribute turned on to be included, "-A" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • S— System: Specifying "+S" causes files with this attribute turned on to be included, "-S" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • H— Hidden: Specifying "+R" causes files with this attribute turned on to be included, "-H" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • C— Compression: Specifying "+C" causes files with this attribute turned on to be included, "-C" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

Description Tab

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Tab

The Error Causes tab allows you to select/omit specific errors that should cause a particular step to fail.

More on Error Causes

On Error Tab

The On Error tab allows you to determine what the task should do if a particular step encounters an error.

More about On Error properties

RASH File Attributes - Overview

File attributes can be specific characteristics or certain permissions set for a file. Every file on your hard disk has one or more attributes; usually, these attributes are turned on and off by system components or external applications. The Set Attributes action allows you to set the attributes if one or more files. Moreover, many file-related actions include attribute properties allowing a way to filter which files worked on based on the current attribute settings of the source file(s). Up to four attributes can be assigned to each file at any one time. They start with the letters R, A, S, H.

R - Read-Only - Files with this attribute cannot be overwritten or erased by standard programs or users.

A - Archive - A system or program uses this attribute to determine which files changed since they were last copied or backed up. Similarly, backup programs like Seagate Backup Exec, Microsoft Backup, etc. all use this attribute to handle what files need to be backed up.

S - System - A file with this attribute is usually one that is an integral part of your operating system. This attribute has a special meaning for DOS and Windows systems.

H - Hidden - A file having this attribute cannot be seen by a normal DOS directory search or cannot be seen if Windows Explorer or similar programs aren't specifically set up to see them.

In visual mode, a group of controls are provided to assist in setting attributes for a file.

The available options are:

In markup mode, a single text item must be specified that contains the attributes of the files you want to modify.

To turn an attribute on/off, use the + and - sign:

For example:

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, % Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables

More on expressions

More on the expression builder