Solved

xcopy - folder to folder

Posted on 2010-08-20
7
642 Views
Last Modified: 2012-06-21
I am looking for a xcopy solution so I can copy C:\test to d:\test - .
First time it is running it copy everything, but afterwards it just has to take the changes since to first backup

Can anyone help ?
0
Comment
Question by:rossoneris
7 Comments
 

Accepted Solution

by:
Amivit earned 125 total points
ID: 33484479
xcopy.exe C:\test\*.* D:\test\*.* /D
add /E uf you wan't to include subdirectories.
xcopy.exe C:\test\*.* D:\test\*.* /D /E

Hope this works for you!
0
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 33484507
I am attaching the code I use.

All you need is schedule it and it will always copy from one folder to another
ugaBKscript.vbs
0
 
LVL 52

Expert Comment

by:Bill Prew
ID: 33490117
==> it just has to take the changes since to first backup

Can you elaborate on what that means?  I can see basically 4 possible situations, can you state what you want to happen in each case?

(1) a file is in both locations and has not changed

(2) a file is in both locations and has changed

(3) a file has been added and only exists in the c:\test folder

(4) a file has been deleted from c:\test, and only exists in d:\test now

~bp
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:Telxon
ID: 33497888
By default, XCOPY will copy all files. Maybe you're unintentionally telling it to skip the existing files? The syntax I almost always use is XCOPY (sourcepath) (destpath) /C/H/E/R/Y . This continues to copy even if error occur, copies hidden, readonly, empty subdirectories and overwrites existing files without prompting.

Hope this helps!
0
 
LVL 2

Expert Comment

by:arch-itect
ID: 33512879
xcopy c:\test\*.* d:\test\ /M

/M only copies files with the archive attribute set and then sets it off

changing a file switches the attribute on again which qualifies it to be copied with /M

0
 
LVL 2

Expert Comment

by:arch-itect
ID: 33528926
Hi rossoneris, did this work for you?
0
 

Expert Comment

by:arielks
ID: 33552093
just add the /Y flag (so it would overwrite without prompt)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now