Created
January 28, 2015 03:00
-
-
Save jcefoli/376a20a0de274a844660 to your computer and use it in GitHub Desktop.
This script takes the contents of one directory and copies them into a newly created folder in all existing subdirectories of the destination directory.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
REM | This script will take all files and subdirectories in | |
REM | C:\Source and copy them into a new folder called "Config" in | |
REM | all subdirectories of C:\Dest. If there are no subdirectories, | |
REM | nothing will happen | |
REM | | |
REM | ie - C:\Source\*.* will be copied to C:\Dest\Folder\Config\*.* | |
REM | assuming "Folder" was a preexisting subdirectory | |
REM :: Define Variables Here :: | |
SET SOURCEDIR=C:\Source | |
SET DESTINATION=C:\Dest | |
SET FOLDERSUFFIX=\Config | |
FOR /D %%a in ("%DESTINATION%\*") do xcopy "%SOURCEDIR%\*.*" "%%a%FOLDERSUFFIX%" /s /i /c /y | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment