How to copy files

  • Thread starter Thread starter hon123456
  • Start date Start date
H

hon123456

Dear all,

I want to copy files from one directory to another
directory. The directory may look like following

c:A\Path-001\..
c:A\Path-002\...
c:A\Path-003\...

Now I need to copy Path-001 to Path-003 to C:\B\, I need to
determine whether Path-001 to
Path-003 already exist in c:\B. If exist, then do not copy. If not
exist then copy Path-001 to Path-003.
Another condition is that if the time stamp of directory Path-001 to
Path-003 is newer in c:\A than c:\B,
then I need to copy the directory again.

How can I do that. Thanks.
 
hon123456 said:
Dear all,

I want to copy files from one directory to another
directory. The directory may look like following

c:A\Path-001\..
c:A\Path-002\...
c:A\Path-003\...

Now I need to copy Path-001 to Path-003 to C:\B\, I need to
determine whether Path-001 to
Path-003 already exist in c:\B. If exist, then do not copy. If not
exist then copy Path-001 to Path-003.
Another condition is that if the time stamp of directory Path-001 to
Path-003 is newer in c:\A than c:\B,
then I need to copy the directory again.

How can I do that. Thanks.

Your conditions are slightly contradictory but the batch
file below will probably do what you want.
@echo off
xcopy /s /d /y c:\A\*.* c:\B\
pause
 
Back
Top