MSDOS - Rename multiple files partially

Solved
CassThor Posted messages 135 Status Member -  
 Anonymous user -
Hello,

An architect made a mistake and sent us nearly 2000 files with incorrect syntax.

The files must follow a very precise naming convention, * being a specific character for the file, always different:

PLN_*****_**_****.pdf

(ex: https://www.zupimages.net/ )

All the files he has been sending us for months are named PNL, which blocks the import into our software.

Here is the .bat file I would like to create:

In the folder, look for files starting with PNL and ending with .pdf
replace the first three characters with PLN.

I must admit that I know nothing about msdos, can someone help me? As a side note, I mention that we do not have admin rights on our PCs.

Thanks to anyone who can help me.

"There are no stupid questions, only stupid answers."

3 answers

  1. CassThor Posted messages 135 Status Member 43
     
    For now, I tested the command:
    ren "PNL_*****_**_****.pdf" "PLN_*****_**_****.pdf"

    However, I get files with this name:
    PLN_87037_01_1010.pdf__

    --
    "There are no stupid questions, only stupid answers"
    0
  2. Anonymous user
     
    Hello
    there are tools that do this very well
    https://www.commentcamarche.net/faq/41797-ant-renamer-renommer-les-fichiers-par-lots

    --
    When I was little, the Dead Sea was just sick.
    George Burns
    0
    1. CassThor Posted messages 135 Status Member 43
       
      Hello,
      I don't have administrator rights, so I can't install software.

      If you know the command that allows this software to do what I'm asking, I'd be interested in that instead. :)
      0
    2. Anonymous user
       
      This is where security policy is a strange thing; for the PCs where I'm not an admin at work, we can't execute .bat either.

      Otherwise, you found it and that's great, but for the next time when it could be more complex, Ant Renamer is portable, meaning no installation is required.
      0
  3. CassThor Posted messages 135 Status Member 43
     
    Problem solved!

    Just type the command:
    ren "PNL*.pdf" "PLN*.pdf"

    --
    "There are no stupid questions, only stupid answers"
    0