xcopy identical file

K

Kanga 85

When using Xcopy in XP I do NOT wish to overwrite a file with an identical
date/time stamp. If no date is given, the /D:m-d-y switch is claimed to
'only copy those files whose source time is newer than the destination time'.
However, I find that the old file is always overwritten by a new file when
the source time is identical. I don't want this.
How do I avoid it?
Thanks.
 
P

Pegasus \(MVP\)

Kanga 85 said:
When using Xcopy in XP I do NOT wish to overwrite a file with an identical
date/time stamp. If no date is given, the /D:m-d-y switch is claimed to
'only copy those files whose source time is newer than the destination
time'.
However, I find that the old file is always overwritten by a new file
when
the source time is identical. I don't want this.
How do I avoid it?
Thanks.

Use the /d switch without any date:

xcopy /d /c /y /s "c:\My Files" "Q:\Backup Folder\"
 
K

Kanga 85

Pegasus (MVP) said:
Use the /d switch without any date:

xcopy /d /c /y /s "c:\My Files" "Q:\Backup Folder\"

I find that the /d switch with no date still copies identical files. A
real pain that I have struggled with for years
 
P

Pegasus \(MVP\)

Kanga 85 said:
I find that the /d switch with no date still copies identical files. A
real pain that I have struggled with for years

I suspect that you are copying files from a medium whose file
system uses a date stamp granularity that differs from the one
available on NTFS partitions. You can get around the problem
by specifying the appropriate switch with xxcopy.exe or with
robocopy.exe. You can download robocopy from a Microsoft
site and xxcopy from a number of independent sites.
 
K

Kanga 85

Pegasus (MVP) said:
I suspect that you are copying files from a medium whose file
system uses a date stamp granularity that differs from the one
available on NTFS partitions. You can get around the problem
by specifying the appropriate switch with xxcopy.exe or with
robocopy.exe. You can download robocopy from a Microsoft
site and xxcopy from a number of independent sites.

Thanks Pegasus, that could be the problem. I'll explore further with
xxcopy and with robocopy.

Another question tho, which might solve my problem. Using Xcopy, copying
from computer A to computer B via a flashdrive, can I find a switch to turn
off the archival bit of the file I have just copied to Computer B? I don't
want to affect all the files in the directory on computer B, just the file
I've copied. I know that /M turns off the archival bit of the copied file
on Computer A, but how do I do the same thing to the written file on computer
B?

Thanks.
 
P

Pegasus \(MVP\)

Kanga 85 said:
Thanks Pegasus, that could be the problem. I'll explore further with
xxcopy and with robocopy.

Another question tho, which might solve my problem. Using Xcopy, copying
from computer A to computer B via a flashdrive, can I find a switch to
turn
off the archival bit of the file I have just copied to Computer B? I
don't
want to affect all the files in the directory on computer B, just the file
I've copied. I know that /M turns off the archival bit of the copied
file
on Computer A, but how do I do the same thing to the written file on
computer
B?

Thanks.

You should use the /d or the /m switch but not both. If you use the /d
switch then the /k switch may be what you're after. Have a good look
at Help for xcopy and xxcopy (or robocopy).
 
K

Kanga 85

Pegasus (MVP) said:
You should use the /d or the /m switch but not both. If you use the /d
switch then the /k switch may be what you're after. Have a good look
at Help for xcopy and xxcopy (or robocopy).
Thanks Pegasus,
My situation appears to be too complex for Xcopy and I will explore Xxcopy.
I have five computers in different locations. I copy any changed files
(archival bit set) in defined directories to a flash drive. When I boot up
the next computer I run my program as the first thing to download any 'newer'
files. I then backup changed files back onto my flashdrive when I've
finished. When the flash drive gets full I empty it after making sure that
all computers have first had a peep at it. This way five computers have the
same working files on them. Xcopy does this reasonably well, but some files
get copied to computer A, back to the flashdrive, onto computer B, back to
the flash drive, etc, without ever having been altered, and this is both
inelegant and slowing of computer time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top