renaming multiple files using the command prompt

Anonymous
2023-11-07T19:28:22+00:00

Hello,

I had a few dozen files that used a naming convention beginning with an abbreviation for a city (in this case, WI) and then an alpha-numeric sequence that was unique to each file. I wanted to rename the files to include the entire city name (in this case, Windsor) without changing the subsequent unique sequences. So I opened command prompt, traced a path to that file, typed in the "dir" command to ensure that I had found the correct folder (I had, the correct files were listed). This is the command that I entered in to change all the file names: ren WI*.* Windsor*.*

After executing that command, the result is that the first file changed names to "Windsor" but eliminated the unique alpha-numeric sequence that followed (I need the alpha-numeric to remain intact) and for every subsequent file, I got the message "A duplicate file name exists, or the file cannot be found." Obviously, I set this up wrong. Can anyone help me with the correct command structure? Thanks...

Chris

Windows for home | Windows 10 | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

11 answers

Sort by: Most helpful
  1. Anonymous
    2023-11-14T06:13:03+00:00

    Hi

    I have found a suitable solution for you, you can refer to this link. Hope it helps!

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2024-01-26T19:37:34+00:00

    This worked great for me. Thank you.

    0 comments No comments
  3. Anonymous
    2024-01-27T05:33:57+00:00

    Just as an FYI, the following tools make bulk renaming very easy:

    https://www.bulkrenameutility.co.uk/

    https://learn.microsoft.com/en-us/windows/powertoys/powerrename

    2 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2024-04-21T01:33:00+00:00

    This is just a suggestion of what might have happened, did you copy the command into notepad before posting into powershell? Because posting straight from webpage or via word can result in hidden characters causing issues.

    I tried the command myself and had no issues.

    2 people found this answer helpful.
    0 comments No comments
  5. Anonymous
    2024-06-04T05:26:03+00:00

    This worked for me also. Modified in Notepad and used in the Powershell window. Thanks.

    0 comments No comments