At first: it's not a repeated question (I hope). I've searched a lot and found How to find files with no file extension in directory tree with a batch file? and Find and rename files with no extension?, among others, but I have a "small" additional problem.
I'm trying to rename multiple (thousands) of jpg files on Windows 10. The name format is "Name (ABC).jpg" or "Multiple Names (ABC).jpg". I need "Some Name.jpg".
What have you tried? So many things, none of them a real solution, until this:
for /f "tokens=1-3 delims=)(" %%a in ('dir /b *.jpg') do @rename "%%a(%%b)%%c" "%%a"
for /R %%x in (*.) do ren "%%x" *.png
It works fine for most of the files, except when there's a dot in the name. If the name is something like "A Name.Supercool (ABC).jpg", it will be only "A Name.Supercool", with no extension.
I know the problem is on (*.), just don't know how to solve...