CIS 51.13 Windows Command Line

© 2006 Eric Skagerberg   (All rights reserved.  This material may not be reproduced in printed or electronic format without the express permission of the author.)
Adjunct Instructor, Computer & Information Sciences Department
Santa Rosa Junior College, California
Last updated on 15 November, 2006 .

· Eric S. Home Page

· Command Line Assignments & Exams Schedule


Full Backups with XCOPY

Use ATTRIB +A before full XCOPY /M backup

Tutorial chapter 5 needs an additional key step on pages 210-211:

Whenever you want to use XCOPY to perform a Full (or Normal) backup of a directory folder branch, first use the ATTRIB command to turn on all the Archive flags, like this (assuming you're already in the base folder of the selected branch):

attrib +a *.* /s

Once you've done this, the /M option of an XCOPY command, like the one on page 211, will copy all the files, because they all now have their archive flag on (/M then turns them all off).

For example, if you wanted to use XCOPY to back up all the current directory folder's files to f:\backup\, you would enter the above, then:

xcopy . "f:\backup" /m /s

This becomes particularly important at the start of a new backup cycle, in which many of the files haven't changed since the last backup, so they still have their archive flags turned off. To use XCOPY /M for a full backup, all the archive flags need to be turned back on.


· Eric S. Home Page

· Command Line Assignments & Exams Schedule