Assuming oldname is required, the following result was found.
commented/remarked @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION FOR /f "tokens=*" %%a IN ('dir /b *" (Copy).jpg"') DO ( SET "oldName=%%a" SET "newName=!oldName: (Copy)=!" ECHO Rename !oldName! to !newName! REM RENAME "!oldName!" "!newName!" ) Save the file...