Copy a file into all sub folders of a folder in windows.

For example you have a folder called  E:\Folder and there are dozens of sub folders under this folder like E:\Folder\1 to E:\Folder\100, now you want to put your input file file.inp into each of these sub folders.

First you put your file.inp under E:\filelocation.

Then you put following text in a new txt file, save it as whatever.bat, a batch file.

for /r “E:\Folder” %%i in (.) do @copy “E:\filelocation\file.inp”

double click to run the whatever.bat, work done.

Sina WeiboShare

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>