Search code examples
batch-filecopydosoverwrite

DOS Batch copy over multiple files


This may be an unusual request, but I have a template ini file that I want to use to overwrite a bunch of ini files in a certain folder. Something like

copy /b/v/y template.ini *gui_settings.ini

or

copy /b/v/y template.ini < dir *gui_settings.ini /b

This does not work.

I even tried

dir *gui_settings.ini /b >files.list
copy /b/v/y template.ini < files.list

...but no dice.


Solution

  • for %%a in ("*gui_settings.ini") do type "template.ini" > "%%a"
    

    For each *gui_settings.ini file found, type the template into the file