Created
August 10, 2012 19:16
-
-
Save pckujawa/3317024 to your computer and use it in GitHub Desktop.
Windows batch script to copy a file to multiple output files if they don't already exist
This file contains hidden or 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
@if "%1"=="" ( | |
@echo Usage: %0 sourceFile file1 [file2 file3 ...] | |
goto :eof | |
) | |
@set sourceFile=%1 | |
@shift | |
:parseparams | |
@if [%1] neq [] ( | |
@if not exist %1 echo F | xcopy %sourceFile% %1 /F /-Y | |
REM If you don't want the prompts displayed onscreen, use the next line instead (but it won't show the paths of the files copied) | |
REM @if not exist %1 copy %sourceFile% %1 /-Y | |
@if %errorlevel% neq 0 pause | |
@shift | |
@goto parseparams | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment