If Folder Exists Action

Description

Causes the steps following this action to execute if the specified folder is in the specified state.  If not, execution follows the next Else or End If action, whichever comes first. Wildcards can be used. To check if a folder exists (or not) and take conditional action depending on the result.

Declaration

<AMIFFOLDEREXISTS ACTION="text [options]" FOLDER="text" EXCLUDE="text" ISNEWERTHAN="datetime" ISOLDERTHAN="datetime" ATTRFILTER="text [attribute mask]">

</AMIF>

Examples

<AMIFFOLDEREXISTS SOURCE="c:\foldername">
<AMMESSAGEBOX>Folder Exists</AMMESSAGEBOX>
</AMIF>

General Tab Parameters

If Folder exists/Folder does not exist: Specifies the type of check to perform:

  • exists: The IF block will be executed if the folder exists.

  • not_exist: The IF block will be executed if the folder does not exist.

Text, Optional Default: exist)
MARKUP: ACTION="not_exist"

Folder name: Specifies the folder to check.

Text, Required
MARKUP: FOLDER="c:\foldername"

Advanced Tab

Exclude Mask: Causes the action to not compress files matching the mask(s) specified. Filenames or wildcard ( e.g. * or ? ) masks may be used, multiple entries may be specified by separating them with the | symbol (e.g. *.txt|*.bak)

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

Only if newer than: Causes the action to only compress files if the source is newer than the date/time specified. If parameter is left blank or not included, the date of the files will be ignored (excluding "Only if newer" [ISNEWER] parameter).

date, Optional default - (none)

MARKUP: ISNEWERTHAN="%DateSerial(2001,10,12) + TimeSerial(00,00,00)%"

Only if older than: Causes the action to only compress files if the source is older than the date/time specified. If parameter is left blank or not included, the date of the files will be ignored (excluding "Only if newer" [ISNEWER] parameter).

date, Optional default - (none)
MARKUP: ISOLDERTHAN="%DateSerial(2001,10,12) + TimeSerial(00,00,00)%"

Click Custom to select from other time options (Last 30 seconds, Last 30 minutes, Last 24 hours, Last 30 Days, Last 12 Months, Last 5 Years, Next 30 Seconds, Next 30 Minutes, Next 24 Hours, Next 30 Days, Next 12 Months, Next 5 Years). A expression appears in the text box (e.g., %DateAdd( "s", -30, CStr( Now() ))%) and the Expression check box is selected. You can also click the Expression Builder icon to build a custom expression.

Attributes Tab

Attributes: This group of settings causes the action to filter which files are checked based on the attribute settings of the source files. In visual mode, a group of controls is 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 wish to check. The available options are:

  • 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 "+H" 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.

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

See Also

Loop, The BASIC Language All Groups, Else