Rename file(s) Action(Power Automate Desktop)

08/24/2023

Japanese version.

This action renames one or more files.

This action is very useful for extension-aware operations, date and sequential numbering, etc.

How to use.

Drag Rename file(s) Action from File onto the workspace.

Set parameters.

Parameters

File to rename

If a file is specified, a single file is targeted; if a folder is specified, all files in the folder are targeted.

If a list variable is specified, multiple files are targeted.

Rename schema

Set new name
ParameterDescription
New file nameSpecify the file name after the change.
If "Keep file extension" is ON, specify the part before the file extension.
If "Keep file extension" is OFF, specify the file name including the file extension.
Keep extensionIf ON, only the extension and before will be changed.

This setting is intended for cases where a single file is the target, as it changes the file name almost uniformly to the same name.

Add text
ParameterDescription
Text to addSpecifies the text to be appended to the file name.
"Add text" specifies which part of the text is to be added.
Add textFor "After name", add after the file name.
For "Before name", it is added to the beginning of the file name.
Remove text
ParameterDescription
Text to removeSpecifies text to be removed from the file name.
If no applicable text is included, no action is taken.
The text is case-sensitive.
Replace
ParameterDescription
Text to replaceSpecifies the text to be replaced from the file name.
If no applicable text is included, no action is taken.
The text is case-sensitive.
Replace withSpecifies the text to be replaced.
Change extension
ParameterDescription
New extensionSpecifies the extension of the file to be updated.
The original extension is not required.
Add datetime
ParameterDescription
Use custom datetimeThe method of specifying the "Datetime to add" differs depending on whether it is ON or OFF.
Datetime to add<ON>
Specifies a variable or fixed value for the Datetime.


<OFF>
Select from the following.
- Current datetime
- Creation time
- Last accessed
- Last modified
Add datetimeIn the case of "After name", it is added between the file name and the file extension.
In the case of "Before name", it is added to the beginning of the file name.
SeparatorSpecify the character to be inserted between the file name and date.
- Nothing
- Space
- Dash
- Period
- Underscore
Datetime formatSpecifies the format of the date and time.
The default format, yyyyMMdd, is year, month, and day.

Make sequential

Basically, it is for multiple files.
Sequential numbers are assigned in the order in which they are registered in the list.

ParameterDescription
Add number toIn the case of "After name", it is added between the file name and the file extension.
In the case of "Before name", it is added to the beginning of the file name.
Start numbering atSpecifies the first number.
Mainly 0 or 1, but it is also useful to store the last number in a file or other format.
Increment bySpecifies the amount of files to count up.
You would primarily specify 1.
Counting down specifies a negative number.
SeparatorSpecify the character to be inserted between the file name and the sequential number.
- Nothing
- Space
- Dash
- Period
- Underscore
Use paddingIf the sequential number is less than the number of digits, it is filled with 0.
The number of digits is specified by "Make each number at least".
Make each number at leastSpecify the number of digits of the sequential number.
If 3 is specified, then 001, 002, 003… and so on.

If file exists

Select the behavior ("Do nothing" or "Overwrite") when the move destination has the same file name.

Variables produced

RenamedFiles

Information on renamed files is stored in a list.

For those who want to learn Power Automate Desktop effectively


The information on this site is now available in an easy-to-read e-book format.

Or Kindle Unlimited (unlimited reading).

You willl discover how to about basic operations.

By the end of this book, you will be equipped with the knowledge you need to use Power Automate Desktop to streamline your workflow.

Links

File Actions

Examples of Use

How to deal with the case where the specified file already exists.

How to put today's date in a folder name or file name.