Rename File Action—Setting Properties

The Rename File action is used to rename files on an individual machine or on a network. If you select a new destination folder, the files are moved in addition to being renamed. You can do multiple file renaming, such as adding a date or changing the extension on a group of files.

To set Rename File properties

  1. From the Task Builder Available Actions pane, open the File folder and double-click the Rename File action or drag it into the Steps pane. The following dialog appears:

  1. In the Original file name box, enter the path and file names for the files to be renamed, or click the Open Folder button and navigate to a file or folder. You can use asterisk (*) and question mark (?) as wildcard characters. For example, use *.DOC to include all files in the selected folder with a .DOC extension. Separate multiple entries with a pipe symbol (|).

  2. In the New file name box, enter the path and the new file name. You can also click the Open Folder button and navigate to a folder to enter the path. When renaming multiple files, use wildcard characters asterisk (*) or questions mark (?). For example, use *.txt to change all to text files, or [Date]*.* to add a date to all files.  

    Folders that do not exist will be created at runtime provided the logged-on user has the rights to do so.

  3. To populate a dataset with the result, enter a name for the dataset in the Create and populate dataset with result information box. (Dataset names must be alphanumeric, begin with a letter, and contain no spaces.)

    The dataset fields will be Source, Destination, Result, and Message. The Result field returns 0 for success or a Windows error code for failure. The Message field provides textual information about the result.

  4. Click the Options tab and select or clear the check boxes according to the following guidelines:

  5. In the Exclude mask box, enter the names of any files or folders within the selected source folder that you want to exclude from the action. You can use asterisk (*) and question mark (?) as wildcard characters. Separate multiple entries with a pipe symbol (|).

  6. To exclude files from the action based on date, select the Only if newer than or Only if older than check boxes. Then use the date and time boxes to select the desired date and time. You can also click the Custom button and select a limiter such as Last 24 hours, or you can select Expression and enter an expression.

  7. To limit the action according to file attributes, click the Attributes tab and then select On or Off for any attributes that you want used as criteria in the file selection. The default is Doesn't matter, which means the attribute will be ignored. The attributes to select from are: Read-only, Archive, System, Hidden, and Compression.

  8. To set the Description tab properties, refer to Description Tab Options.

  9. To set the Error Causes and On Error tab properties, refer to Step Error Handling.

  10. When finished, click OK to save settings and close the properties dialog window.

See Also

About Actions

Adding Task Steps

Rename File Action