Copying a file to multiple locations or folders is not a big deal. You can easily perform it by drag and drop method or copying the file first and then pasting it on all the folders of your system. In Windows 10, there is an alternate way by which you can copy a file to multiple folders without consuming much time. Before we show the steps, we must admit that this is just an alternative to save your time, but it lacks flexibility and has a lot of restrictions. For example, if the folders, where you want to copy the file are in different locations, or drives, then the process won’t work for you. So, if the folders are in different locations, then you have to bring them under one common folder, which ultimately nullifies the effect of time saving.
So, to begin with, you have to create a batch script. For that, open Notepad and paste the following text in it.
@echo off for /D %%a in ("path-to-folder\*.*") do xcopy /y /d path-to-file\file.FileExt "%%a\"
Save the script in BAT file format and run it. On the above script, you have to make some edits. You will need to make edits to this script before you can save it. Check out what changes are to be made:
I have created a test file that I want to copy. I have named it MWH.txt. It is a notepad file to be precise. I have created a folder name Destination Folder. Within, the destination folder, there are three more sub folders namely, destination 1, destination 2 and destination 3 respectively.
So, replace path-to-folder by the path to the Destination Folder . Replace the file.FileExt by the text.txt file, which is my test file.
@echo off for /D %%a in ("path-to-folder\*.*") do xcopy /y /d path-to-file\file.FileExt "%%a\"
@echo off for /D %%a in ("
C:\Users\wayto\Desktop\Destination Folder\*.*") do xcopy /y /d
C:\Users\wayto\Desktop\Source\text.FileExt "%%a\"
If you want, instead of using the batch file, you can edit the text and use it directly as commands on Command prompt. Open Cortana and type command prompt. As Command Prompt appears in search results, right click on it and click on “Run As Administrator”.
Change the command prompt command as the following:
@echo off
for /D %a in ("C:\Users\wayto\Desktop\Destination Folder\*.*") do xcopy /y /d C:\Users\wayto\Desktop\Source\text.txt "%a\"
You can check the progress of copy also.
The files have been copied.