Batch: Create a list of folders and then copy multiple files/folders into all of them -


i cad manager in need of help. no programmer, have basic understanding of dos commands thought use xcopy this, don't know how.

i have folder, under hundreds of subfolders change time (each employee has 1 folder) maintaining manual listing (as have been doing) not easy. have _template subfolder contains several files , folders.

i copy contents of _template folder other subfolders, overwriting existing files , creating non-existing folders.

from i've seen searching in here seems pretty easy accomplish these 2 tasks (to create list of folders , copy list of folders) i'm dumb understand how combine 2 1 file :)

edit :

well, i've found powershell script need perfectly. since managed run powershell guess problem solved :d

$folder = get-childitem -name -exclude *.*,_template foreach ($f in $folder)     {xcopy "_template\*.*" "$f" /e /r /y } 

thanks fish ;)

try this:

@echo off &setlocal cd /d "rootfolder=x:\folder\to\my data" /d %%a in (*) xcopy "_template" "%%~fa" /sihrky 

for xcopy options see xcopy /?, test command without writing add option /l.


Comments