Sometimes it is necessary to place a file or document to all the folders. When you have multiple files and multiple folders, it becomes a complex task. As opening each folder individually and placing the same file everywhere takes a lot of time. Although Ctrl+C and Ctrl+V is quick but it works only when you have a small number of folders to place the file.

You can use it in batch mode in Windows 10 which saves a lot of time and automates the task.

Copying the File to Multiple Folders in Windows 10

A script is there to copy files to multiple folders. The limitations to this script is that the file you need to copy in multiple folders is in the same directory. All you need is to open the Notepad and place the given script with the file name with the path as path-to-file\file.FileExt and path as path-to-folder\*.*

@echo off

for /D %%a in ("path-to-folder\*.*") do xcopy /y /d path-to-file\file.FileExt "%%a\"

After replacing the paths without removing the quotes and save the file as BAT extension and run it. The file will be automatically copied to all the subfolder.

Copy a file to multiple folders in Batch Mode

An alternative to the batch script is to run directly into the command prompt just by using the given command with the specific file name and path.

for /D %a in ("c:\path-to-folder\*.*") do xcopy /y /d c:\test\file.FileExt "%a\"

Copy a file to multiple folders in Command Prompt

Leave a Reply

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