Touch File Action

Declaration

<AMTOUCHFILE FILE="text" CREATIONTIME="%DateSerial(2009,01,01)+TimeSerial(00,00,00)%" LASTACCESSTIME="%DateSerial(2009,01,01)+TimeSerial(00,00,00)%" LASTWRITETIME="%DateSerial(2009,01,01)+TimeSerial(00,00,00)%" READONLYFILE="touch" SUBFOLDERS="YES" ISNEWERTHAN="%DateSerial(2009,02,03)+TimeSerial(08,07,06)%" ATTRFILTER="-r-a-s-h-c-e" />

See Also

Calculate File Checksum Action, Read from File Action, Write to File Action, Get File(s) information Action

Description

Touches file(s) in order to update their creation time, modified time or last accessed time.

Practical Usage

See Description

Parameters

General Tab

File

Text, Required
MARKUP:
a) FILE="C:\sourcefoldername\file.txt"
b) FILE="C:\sourcefoldername\*.txt"
c) FILE="C:\sourcefoldername\*.txt|C:\sourcefoldername\*.doc"
d) FILE="file.txt"

 

Specifies the file(s) that should be affected by the creation, modification or last accessed time modification. 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. Multiple file and/or file masks may be specified by separating the entries with a pipe symbol (|).

 

 

Creation Time

Text, Optional
MARKUP: CREATIONTIME="%DateSerial(2009,01,01)+TimeSerial(01,10,00)%"

 

When set to YES, specifies the date/time that the chosen file(s) creation time should be updated to.

 

 

Last Accessed Time

Text, Optional
MARKUP: LASTACCCESSTIME="%DateSerial(2009,01,01)+TimeSerial(01,10,00)%"

 

When set to YES, specifies the date/time that the chosen file(s) last access time should be updated to.

 

 

Last Write Time

Text, Optional
MARKUP: LASTWRITETIME="%DateSerial(2009,01,01)+TimeSerial(01,10,00)%"

 

When set to YES, specifies the date/time that the chosen file(s) last write time should be updated to.

 

 

Advanced Tab

Touch Date

When set to YES, specifies that the date of the chosen file(s) will be touched.

Touch Time

When set to YES, specifies that the time of the chosen file(s) will be touched.

If file is read-only

Text, Required
MARKUP: READONLYFILE="touch"

 

Specifies what to do if the file is read only.

The available options are:

 

 

Options Tab

Include Subfolders

Text, Required
MARKUP: SUBFOLDERS="YES"

 

When set to YES, specifies that, if present, subfolders should be searched for files matching the mask specified in the File parameter.

 

Exclude Mask

Text, Optional, Default: (blank)
MARKUP: EXCLUDE="*.txt"

Causes the action not to affect files matching the masks specified. Filenames or wildcard masks may be used. Multiple entries may be specified by separating them with a pipe symbol (|), for example: *.txt|*.bak

Only if Newer Than

Date, Optional, Default: (none)
MARKUP: ISNEWERTHAN="%DateSerial(2007,02,01) + TimeSerial(00,00,00)%"

Causes the action to only affect files if the source is newer than the date/time specified. If this parameter is left blank or not included, the date of the files will be ignored (unless limited by the Only if older than parameter).

Only if Older Than

Date, Optional, Default: (none)
MARKUP: ISOLDERTHAN="%DateSerial(2007,02,01) + TimeSerial(00,00,00)%"

Causes the action to only affect files if the source is older than the date/time specified. If this parameter is left blank or not included, the date of the files will be ignored (unless limited by the Only if newer than parameter).

 

Attributes Tab

Attributes

Text, Optional, Default: (blank)
MARKUP:
ATTRFILTER="+R+A-S-H" (change attributes on read-only and archive files, not on system or hidden files)
ATTRFILTER="-S" (do not change system files)

This group of settings causes the action to filter which files are affected by the attribute change based on the original attribute settings of the source files.

In visual mode, a group of controls are provided to assist in the selection of this parameter. In AML mode, a single text item must be specified that contains the original attribute mask of the files you wish to affect.

Available Options:

Notes

Custom Description

This action includes the Description tab for entering a custom step description.

More on setting custom step description

Standard Error Handling Options

This action also includes the standard Error Causes and On Error failure handling options/tabs.

More on Error Handling Options

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

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

<AMTOUCHFILE FILE="C:\Temp\TestFile.txt" CREATIONTIME="%DateSerial(2009,02,04)+TimeSerial(11,19,29)%" LASTACCESSTIME="%DateSerial(2009,02,04)+TimeSerial(11,19,29)%" LASTWRITETIME="%DateSerial(2009,02,04)+TimeSerial(11,19,29)%" />