KeyRoutines
StepFreefile.rename

Rename files automatically with dates on Windows 11

Rename file changes a file or folder's name without moving it. You can write a whole new name, or find and replace part of the current one.

How it works

  • In new-name mode you write the name, often with values such as the original name and today's date.
  • In replace mode you give text to find and what to put instead; advanced options add case matching and regular expressions.
  • The extension is kept by default, so .pdf is added back when your new name doesn't include it.
  • If the name is taken it can skip, replace the other file, or add a number.
  • The result is always a plain name in the same folder, and a folder trigger watching it won't fire for this rename.

Routines that use it

Date-stamp downloads

When Download finished catches a PDF, rename it to its original name followed by today's date.

Clean up camera names

Use replace mode to strip IMG_ from new photos dropped in a folder watched by Folder changed.

Number each export

Read a counter with Read JSON value and rename each new export as Episode plus that number.

Settings

SettingWhat it does
PathThe file or folder to rename.
ModeWrite a new name, or replace text in the current one.
New nameThe new name, e.g. {{ trigger.file.stem }} 2026-10-06.
FindThe text to look for in the name.
Replace withWhat to put instead (empty removes it).
Use regexadvancedTreat the text to look for as a regular expression ($1 in the replacement is the first group).
Match caseadvancedOnly match the same upper and lower case.
Keep extensionKeep the file's extension (.pdf) when the new name doesn't have it.
If existsWhen a file with the new name is already there.

Good to know

  • A new name can't contain a folder path; use Move or copy file to put it elsewhere.

Questions

How do I add today's date to a file name automatically?
In Rename file, write a new name that includes the date value, for example the original name followed by today's date. Run it from a Download finished or Folder changed trigger.
Will it change the file extension by mistake?
No. Keep extension is on by default, so the original extension stays unless your new name already ends with it.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.