SS64 Discussion Forum

You are not logged in.

  • Index
  • » Guestbook
  • » XCOPY with /D - sorry but your explanation is wrong

#1 2010-01-11 05:36:31

Ian Garrett
Just Registered
Registered: 2010-01-11
Posts: 1

XCOPY with /D - sorry but your explanation is wrong

Many thanks for a most useful resource.  May I help to make it better by asking you to correct your entry for XCOPY?

/D:m-d-y     Copies files changed on or after the specified date.
               If no date is given, copies only those files whose
               source time is newer than the destination time.

This "newer than" feature is frequently used to update whole trees with new files.

Thanks
Ian

Offline

#2 2010-01-11 13:05:22

Simon Sheppard
Super Administrator
Registered: 2005-08-27
Posts: 506
Website

Re: XCOPY with /D - sorry but your explanation is wrong

The page currently has this

   /D:mm-dd-yyyy
                Copy files that have changed since mm-dd-yyyy.
                If no date is given, the default is to copy
                files with a modification date before today.
                (at least 1 day before)

What do you think is incorrect? the date format?

Offline

#3 2010-01-13 06:59:02

bluesxman
Sun Fire
From: Leeds, UK
Registered: 2006-12-29
Posts: 702

Re: XCOPY with /D - sorry but your explanation is wrong

Well your text does differ from what I get when I do "xcopy /?" -- I get the same as Ian posted (Win2000, WinXP, Win2008) -- and they definitely seem to imply different behaviour.

Offline

#4 2010-01-13 08:26:24

Chimaera
IA-32
Registered: 2009-08-24
Posts: 121

Re: XCOPY with /D - sorry but your explanation is wrong

/D:m-d-y     Copies files changed on or after the specified date.
             If no date is given, copies only those files whose
             source time is newer than the destination time.

I get this on win 7 Home Premium

Offline

#5 2010-01-13 13:35:47

Simon Sheppard
Super Administrator
Registered: 2005-08-27
Posts: 506
Website

Re: XCOPY with /D - sorry but your explanation is wrong

In WinXP XCOPY /D doesnt work unless you use 2 digits for month and day i.e. 01-01-2010 rather than 1-1-10

So the standard help is a bit misleading there, unless this has changed in Vista/Win7 ?

Offline

#6 2010-08-26 03:33:41

Simon Sheppard
Super Administrator
Registered: 2005-08-27
Posts: 506
Website

Re: XCOPY with /D - sorry but your explanation is wrong

OK I see the problem now, After some more testing, the microsoft help for this on Windows 7 and 2008 is wrong, the part: "If no date is given, copies only those files whose source time is newer than the destination time." is not behaviour I'm able to reproduce.

xcopy /D will always overwrite based on the modification date/time of the source file, no matter what the date or time of the destination file.

At first I thought maybe the help was supposed to read "If ONLY a date is given (no time), copies only those files whose source time is newer than the destination time." but there is no documented way to specify a time, and it doesnt follow that behaviour either.
By default i.e with no date specified, xcopy /D will copy files up to 47 Hours 59:59 Minutes old depending on the time of day you run the command.

I've changed the SS64 description to this:

/D:mm-dd-yyyy
                Copy files that have changed since mm-dd-yyyy.
                (files changed on or after the specified date)
                If no date is given, the default is 1 day ago
                (files changed on or after 00:01 yesterday.)

It looks like this has been an issue for a while - this KB is from NT4 days, which has me wondering if this is a documentation error or a bug in XCOPY?
http://support.microsoft.com/kb/194918

Offline

#7 2010-09-05 07:27:03

podraig
New Shoes
Registered: 2010-09-05
Posts: 4

Re: XCOPY with /D - sorry but your explanation is wrong

I don't understand the confusion.

The KB is related to a UTC issue.

I have been using xcopy in production for a few years... the /D switch does exactly as stated in the microsoft documentation.

I do not see what the use of the stated function would be
"                If no date is given, the default is to copy
                files with a modification date before today.
                (at least 1 day before)"

Offline

  • Index
  • » Guestbook
  • » XCOPY with /D - sorry but your explanation is wrong

Board footer

Powered by FluxBB