Skip to content

PowerRename counter does not increment for the next row when it finds a file which already has the correct counter value, causing duplicate file names #33884

@kitbs

Description

@kitbs

Microsoft PowerToys version

0.82.0

Installation method

PowerToys auto-update

Running as admin

Yes

Area(s) with issue?

PowerRename

Steps to reproduce

I have a set of files that needs to remain in a specific order, but new files will occasionally be inserted between two existing files. I have used a 010, 020, 030 prefix so the numbering is sparse enough to insert the new file as e.g. 025, 028 etc. without needing to manually renumber all the files after it. (The way we used to do with BASIC line numbers. 👴)

Occasionally, I have wanted to renumber all the files so they go back to neat increments of 10, so I reached for PowerRename.

I have found that when PowerRename finds a file in the sequence that already has the correct counter value (so does not need to be renamed), it does not increment the counter, which means the next file becomes a duplicate number.

image

✔️ Expected Behavior

Given the following input files:

  • 010 Filename.txt
  • 020 Filename.txt
  • 025 Filename.txt
  • 030 Filename.txt

The output should be:

  • 010 Filename.txt -> 010 Filename.txt
  • 020 Filename.txt -> 020 Filename.txt
  • 025 Filename.txt -> 030 Filename.txt
  • 030 Filename.txt -> 040 Filename.txt

❌ Actual Behavior

The output is instead:

  • 010 Filename.txt -> 010 Filename.txt
    • The file did not need to be renamed, as expected
  • 020 Filename.txt -> 010 Filename.txt
    • The counter did not increment on the previous file, so has created a duplicate file name
  • 025 Filename.txt -> 020 Filename.txt
    • The counter incremented successfully for the first time, but is 10 behind the expected value
  • 030 Filename.txt -> 030 Filename.txt
    • The counter didn't increment previously, so this file did not need to be renamed but should have been

Other Software

No response

Metadata

Metadata

Assignees

Labels

Issue-BugSomething isn't workingNeeds-TriageFor issues raised to be triaged and prioritized by internal Microsoft teamsProduct-PowerRenameRefers to the PowerRename PowerToy

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions