Replacing a file into multiple folders/subdirectories

Viewed 17344

Is there a way in command prompt to take one file and copy it into another folder and its subdirectories based on its name?

I have an image named 5.jpg that has been put in a sub-folder that is in every folder in a directory. I want to do a search inside of the folder (with the old image) and its sub-folders and replace all of the results with the new image.

3 Answers

To do this work with several files, both paths are needed enclosed in quotes:

replace "C:\*.Txt" "C:\Some_Root_Folder_Which_Contains_Multiple_SubFolders" /s

The asterisk to make changes on all files with the ".txt" prefix.

Related