Windows 10: Batch command to put Template Docx in all subfolders Solved


  1. Posts : 1
    Windows 10 Enterprise
       12 Mar 2018 #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 ComputerSystem Spec

  2.    12 Mar 2018 #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:

    Click image for larger version. 

Name:	Capture.PNG 
Views:	0 
Size:	13.0 KB 
ID:	180599
      My ComputerSystem Spec


 

Related Threads
I created a simple command from powershell that maps a drive for me using the "net share" command (see below). However, i want to turn this in to a batch file so I do not have to type it every time. When I name it filename.bat and try to run it, I...
I mean. I have many many docx documents under a directory. I can remember there is one keywords in the lines of the document, but I don't know which document it is. And the filename does not contain the keyword. How can I find out which document it...
I am running Hyper-V on Windows 10. I am using the PC for media playback / gaming in big screen and rarely see the desktop. I have an service running and APP on my phone, so i can start batch files and programs without the need for a KB/M. I...
Batch file hide command window in General Support
I have a batch command to back up a subdirectory: xcopy "C:\All\*" "E:\Allback\*" /E /Q How can I hide the command window during the execution?

Tags for this Thread

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 16:24.
Find Us