Batch command to put Template Docx in all subfolders


  1. Posts : 1
    Windows 10 Enterprise
       #1

    Batch command to put Template Docx in all subfolders


    I need to put a word docx template in over 200 folders that are under one primary folder. Looking for a way to do this without manually saving it in every folder.
      My Computer


  2. Posts : 5,478
    2004
       #2

    You can do it easily in powershell, changing the 2 bits in red:
    Code:
    $Directories=Get-ChildItem "C:\Temp" -Directory -Recurse
    ForEach ($Directory in $Directories) { Copy-Item "C:\Temp\MyFile.docx" $Directory.FullName }

    The top one "C:\Temp" is your primary folder that the subfolders are under.

    The bottom one "C:\Temp\MyFile.docx" is the location of document you want to copy - it need not be in same folder it can be somewhere else.

    It will look like this when you type it in:

    Batch command to put Template Docx in all subfolders-capture.png
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:55.
Find Us




Windows 10 Forums