ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE. Software > Finished Programs

DONE: Copy one particular file into every folder in a subdirectory

<< < (2/4) > >>

Thanks!  :Thmbsup:

We could write a 100-line batch file to do this.-nkormanik (April 04, 2013, 05:59 PM)
--- End quote ---
It could be made smaller than that with a "SWEEP" aka "GLOBAL" type utility that repeats a command in every directory matching a filespec.  Some can be found in the Fidonet batch programming echo's file depository,  These are old, though, and I don't know how well they'd work in current Windows consoles.

You folks are amazing.  Another one DONE!

Thanks so much.

Oh my, let's do it even easier.  Open a command prompt in the top folder and try:

           for /r %I in (.) do copy c:\folder\source.txt %I\target.txt

If you run it from a batch file you'd need to double the % marks.  Or if you don't want to navigate to the top folder for your command prompt, just enter its path after the /r and before the %I.

Edit: looking back at the original post, you could open a command prompt on your desktop (very easy with ContextConsole shell extension by the way) and enter the command as:

          for /r c:\1 %I in (.) do copy file.txt %I\file.txt

I've used c.gingerich's created program -- SubCopy -- a couple of times now, and it makes the task a piece of cake.

The great thing about these threads is that anyone searching the Internet trying to find a similar solution will probably be directed here.  Makes life a lot easier.


[0] Message Index

[#] Next page

[*] Previous page

Go to full version