6

When you create, or copy many objects with the same name
— Windows numerates them in round brackets automatically, like this:

New folder
New folder (2)
New folder (3), etc.

Or this:

New folder — copy
New folder — copy (2)
New folder — copy (3), etc.

The problem (!!!) reveals when initial object alredy has such number in its name:

New folder (2)
New folder (2) — copy
New folder (3) — copy
New folder (4) — copy, etc.

Instead of:

New folder (2)
New folder (2) — copy
New folder (2) — copy (1)
New folder (2) — copy (2), etc.

So, Windows doesn't actually care about saving original name of the object: it uses the first round brackets that are available (say, before the sign).

To start solving this one can go to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\NamingTemplates
and create RenameNameTemplate and CopyNameTemplate string values with desirable names (source).

That made me wonder if someone can help me with any of these solutions:

  1. Find another registry key to modify that "numeration" feature.

  2. Or use some magic words inside NamingTemplates to mask, say, a time and date of creation in the object's name; something like this:

    New folder %year.%month.%day %hours-%minutes 00 %seconds
    New folder %year.%month.%day %hours-%minutes 01 %seconds
    New folder %year.%month.%day %hours-%minutes 02 %seconds, etc.
    
2
  • 1
    @ScienceDiscoverer: As @Victor Novak said, Process Monitor can help find registry values that don't exist by default. If you set the filters for Prcesss Name is explorer.exe, Operation is RegQueryValue, and Result is Value not found and capture data while you perform an operation such as Copy or Rename, it will capture every attempt to query a non-existent value. From there it's often a game of educated guessing. I've found several undocumented tidbits that way. Feb 3, 2023 at 16:52
  • 3
    @VictorNovak: As to your original question, I've played with the themplate values in the past when a similar question was asked, and I never found any "magic" syntax to add currnet date or intelligent numbering. For renaming, take a look at PowerToys PowerRename. It gives you more control over the construction of the new name. Feb 3, 2023 at 17:10

3 Answers 3

1

To add the time and date to the default file name template in Windows, you can use the following steps:

  • Right-click on the desktop or in a folder where you want to create a new file.

  • Select "New" and then "Text Document" or any other type of file you want to create.

  • Right-click on the new file and select "Rename".

  • Change the file name to something like "New File [date] [time].txt" or "New File year-month-day hour-minute-second.txt".

  • Press the "F2" key to make the file name editable.

  • Hold down the "Alt" key and type the following codes on the numeric keypad:

    [date]: 010 (dd/mm/yy format) or 012 (mm/dd/yy format)

    [time]: 014 (hh:mm format) or 015 (hh:mm:ss format)

  • Release the "Alt" key and press "Enter" to save the changes to the file name.

  • The time and date will be automatically inserted into the file name.

2
  • 1
    Welcome to the community. Seconding @Toto - your steps do not explain how to change Windows default name template. I'd suggest deleting it, this kind of answers tend to get flagged as low-quality. I'd recommend checking superuser.com/help, sections about asking and answering (for example how to write good quality answers) to learn how things work. Feb 4, 2023 at 11:15
  • not solving my problem, but is still interesting; thank you! Feb 4, 2023 at 13:39
1

You can do something like this with the Totalcommander shareware, using the built-in Multi-rename-Tool. In the picture below you can see an example, foramatted as in your question.

enter image description here

The clear advantage over any Windows registry feature, and reason why I add this here, is that you can easily change the command to your needs in different situations. Totalcommander even allows you to save separate templates as separate commands, for different use cases.

While this is not free software, the evaluation copy you can download is fully functional.

0

Changing the NamingTemplate (for Copy or Rename) is not going to work, as you have discovered. The only argument to 'printf' or the equivalent function it is using is the original filename. If you specify %d as an example, it just tries to convert the filename to decimal.

Maybe a copy replacement exists that would do this, but I have not found it.

You could write a utility and add/replace the to right click menu in file explorer. Then it could do whatever you want.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .