Description |
Renames one or more files from a source path to a destination path. Supports multiple file renaming, such as adding a date or changing the extension on a group of files. To specify more than one file, use wildcard characters (* or ?). To specify multiple file names or wildcard masks, separate them with a pipe symbol. Example: c:\*.txt|c:\*.bak. |
Declaration |
<AMFILERENAME SOURCE="text" DEST="text" SUBFOLDERS="yes/no" KEEPFOLDERSTRUCT="yes/no" OVERWRITE="yes/no" ISNEWER="yes/no" OVERWRITEREADONLY="yes/no" OVERWRITEHIDDEN="yes/no" ONLYIFEXIST="yes/no" ISNEWERTHAN="date" ISOLDERTHAN="date" ARCHIVETURNOFF="yes/no" EXCLUDE="text" ATTRFILTER="text" RESULTDATASET="Text" /> |
Examples |
<AMFILERENAME SOURCE="c:\folder1\*.*" DEST="c:\folder2\" SUBFOLDERS="YES" OVERWRITE="YES" /> <AMFILERENAME SOURCE="c:\folder1\originalname.txt" DEST="c:\folder2\newname.txt" SUBFOLDERS="YES" OVERWRITE="YES"> <AMFILERENAME SOURCE="c:\folder1\*.*" DEST="c:\folder2\" SUBFOLDERS="YES" OVERWRITE="YES" ISNEWERTHAN="%DateSerial(2001,10,12) + TimeSerial(00,00,00)%" RESULTDATASET="RenamedFilesDS" /> <AMFILERENAME SOURCE="C:\FolderName\FileName1.doc" DEST="C:\FolderName\FileName2.doc" OVERWRITE="YES" ISNEWER="YES" OVERWRITEREADONLY="YES" ATTRFILTER="-a-s" RESULTDATASET="RenamedFilesDS" /> |
General Tab Parameters |
Original file name: Specifies the files to rename. This can be a fully qualified path and filename (preferred) or a file name only (requires use of the Change Folder action). Wildcard characters (* or ?) may be used to rename files matching a certain mask. Multiple files and file masks may be specified by separating the entries with a pipe (|) symbol. Text, Required New file name: Specifies the destination folder and (optionally) the filename for the files being renamed. This can be a fully qualified path or a filename. Folders specified that do not exist will be automatically created at runtime. Wildcard characters (* or ?) may be used. Text, Required Create and populate dataset with result information: Specifies the name of a dataset to be created and populated with the result. In addition to the standard dataset fields, the dataset will contain the following:
Text, Optional |
Options Tab |
Include Subfolders: When set to YES (selected), specifies that, if present, subfolders should be searched for files matching the mask specified in the Source [SOURCE] parameter Yes/No, Optional, Default: NO Preserve folder structure: Valid only if the Include subfolder [SUBFOLDERS] parameter is YES. When set to YES (selected), specifies that subfolders found in the source folder should be created in the destination folder and source files should be copied into their respective folders rather than directly into the root of the target folder specified in the Destination [DEST] parameter. If the Include subfolders [SUBFOLDERS] parameter is set to NO this parameter is ignored. Yes/No, Optional, Default: YES Overwrite if exist: When set to YES (selected), specifies that, if files already exist in the destination folder, they should be overwritten. Yes/No, Optional, Default: NO Only if newer: Valid only if the Overwrite if exist [OVERWRITE] parameter is YES. When set to YES (selected), specifies that only files that are newer than those in the destination folders will overwrite existing files Yes/No, Optional, Default: NO Only if exist in destination: Valid only if the Overwrite if exist [OVERWRITE] parameter is YES. When set to YES (selected), specifies that only files that already exist in the destination will be copied from the source. All other files, regardless of whether they match the mask or other parameter settings will be bypassed. Yes/No, Optional, Default: NO Overwrite read-only files: Valid only if the Overwrite if exist [OVERWRITE] parameter is YES. When set to YES (selected), specifies that already existing files should be overwritten even if the file in the destination is marked with the read-only attribute. By default, read only files are not overwritten. Yes/No, Optional, Default: NO Overwrite hidden files: Valid only if the Overwrite if exist [OVERWRITE] parameter is YES. When set to YES (selected), specifies that already existing files should be overwritten even if the file in the destination is marked with the hidden attribute. By default, hidden files are bypassed. Yes/No, Optional, Default: NO Turn archive attribute off: When set to YES (selected), specifies that the archive attribute of the source files should be switched OFF. The Windows archive attribute is generally used to track whether a file has been backed-up; turning the source file's archive attribute off indicates to many backup programs that the file has already been backed-up. Yes/No, Optional, Default: NO Exclude mask: Causes the action to not copy 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 Text, Optional, Default: (blank) Only if newer than: Causes the action to only copy 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) Only if older than: Causes the action to only copy 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) 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 copied based on the attribute settings of the source files. 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 wish to copy. The available options are:
Text, Optional (blank) |