how to simplify my command for backup purpose

T

Tom Lavedas

src
|_____folder1
|_____folder2
|_____folder3
|
.
._____*.dll
._____*.exe
._____*.otherformat

i need copy to the target, the struct of the target folder should be
like this:
target
|______folder1
|______folder2
|______folder3
|______*.dll
|______*.exe

everything under folder1,folder2,folder3 should be copied

right now i use following command:
<<<<<<<<<<<<<<<<<
for /D %%i in (%SourceDir%\*.*) do @(
mkdir %TargetDir%\%%~ni
xcopy %%i %TargetDir%\%%~ni /e /s /y /i /q )

xcopy %SourceDir%\*.dll %TargetDir% /y /i /q
xcopy %SourceDir%\*.exe %TargetDir% /y /i /q



i could copy them seperately, but i'm sure there must be some better
way to achieve this, can anyone teach how?

Please use limited cross-posting, rather than multi-posting.

It's easier on readers/responders.

Find an answer in alt.msdos.batch.

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top