1

I'm trying to replace multiple image files with one image file, for the ease of editing my images. I need an automated way of copying over every file (preferably a batch script or using command prompt). I need every file with the extension of .png to be replaced with template.png, however, the files need to retain their names.

  • 2
    provided the template is not in the current folder, cmd line: for %P in (*.png) do copy "x:\path\template.png" "%~fP" In a batch file double the percent signs %%P,%%~fP – LotPings Aug 5 '19 at 14:44
  • @LotPings do I run this inside of the folder where the files that I want to replace are stored? – three Aug 5 '19 at 14:53
  • 2
    Yes, either that or provide a path with y:\path\*.png – LotPings Aug 5 '19 at 15:00
  • @LotPings Thanks, that worked a charm, I'll add it as an answer. – three Aug 5 '19 at 15:38
-1

Type into the command line (at the current directory):

for %P in (*.png) do copy /Y "t:\he\path\to\the\template.png" "%~fP"

Thanks LotPings!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.