copy to two or more destination

Microsoft Windows xp professional w/serv...
January 20, 2010 at 09:01:33
Specs: Windows XP
Batch file:
How can I copy file to two or more different destinations?

See More: copy to two or more destination

Report •


#1
January 20, 2010 at 12:08:06
@echo off
echo.
xcopy "filename.extension" "destinationfolder"
exit

if you need to copy to more locations just copy the xcopy line
and change the destination path to the second one you
desire, or however many

goodluck

-ZIEX / Robby


Report •

#2
January 20, 2010 at 13:54:57
also you could: (not tested)
@echo off & setlocal
set x=%1
if "%x%" equ "" set x=?
if "%x:-1%" equ "?" (
echo usage: %0 file dir1\[newnameA] dir2\[newnameB] ...
echo copies file to each named directory, optional namechange.
goto :eof
)
:00
if "%2" equ "" goto :eof
copy %1 %2
shift
goto :00

Report •

#3
January 21, 2010 at 07:32:52
tested:

@echo off

if -%1==- goto error1

:loop
set param=%1
echo copy source %param%
shift
if -%1==- goto :eof
goto loop

:error1
echo.
echo USAGE : %0 target1 [ target2 [ ... ] ] ]
echo.
echo Use double quotes to indicate whitespace paths:
echo %0 "C:\Program Files"
goto :eof


Report •

Related Solutions


Ask Question