Directory
(1)
Xcopy
(1)
Lab
(1)
Starters
(1)
DOCTYPE
(1)
Attrib
(1)
CMD
(1)
DTD
(1)

Xcopy - "M" switch question

Asked By JohnB
23-Jan-10 10:40 AM
This is probably considered OT for this group, but I did not see where else
to ask it, and I know there are some people here that use batch files a lot.

I have this command:   xcopy c:\MyFiles\*.*  F:\Backup\*.* /S /Y /M
(there are a lot of sub-folders)

But it backs up the entire contents of the folder, everytime.  The files are
photos.  Nothing has changed.  I ran it the first time without the "M"
switch.  But after adding that switch it still backs up every  single file.

Any ideas?

Thanks.

Probably because archive (A) attribute is set on every single file.

Dusko Savatovic replied to JohnB
23-Jan-10 11:24 AM
Probably because archive (A) attribute is set on every single file.
You can check in CMD console with a command:
attrib

Possibly the archive bit is not being reset when you run the program, as

Richard Mueller [MVP] replied to Dusko Savatovic
23-Jan-10 12:06 PM
Possibly the archive bit is not being reset when you run the program, as it
should, because you have permission to copy, but not permission to modify in
the source folder. Otherwise, you might try the /D switch, which will only
copy if the source is newer than the target. Also, you might try RoboCopy.
This is available in newer OS's and is very powerful.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.

Jonathan de Boyne Pollard replied to JohnB
24-Jan-10 11:02 AM
http-equiv="Content-Type">
did not see where else to ask it, [...]<br>
F:\Backup\*.* /S /Y /M </code><br>
(there are a lot of sub-folders) But it backs up the entire contents of
the folder, everytime. The files are photos. Nothing has changed. I ran
it the first time without the "M" switch. But after adding that switch
it still backs up every single file.<br>
whether the attribute was turned off and really is still off?  Prove
that the attribute is being turned off and is remaining off.<br>
Post Question To EggHeadCafe