xcopy help

Discussion in 'NZ Computing' started by C, Dec 1, 2003.

  1. C

    C Guest

    I've got a simple batch file which I use to backup my files from one
    hard drive to another.

    I'm using the /y switch to suppress the prompt when I'm overwriting an
    existing file.

    This seems rather wasteful and inefficient - why copy the same file
    over itself?

    Is there a way to make it so if the file exists then it won't copy the
    file?
    C, Dec 1, 2003
    #1
    1. Advertising

  2. C

    Ron McNulty Guest

    >>why copy the same file over itself?

    The problem is how to decide the file is "the same file". Either may have
    been modified (say just a few bytes changed), or they could be identical
    data-wise yet have different time stamps or attributes. XCopy takes the easy
    way out and copies it anyway.

    Regards

    Ron
    Ron McNulty, Dec 1, 2003
    #2
    1. Advertising

  3. In article <>,
    says...
    >
    > I've got a simple batch file which I use to backup my files from one
    > hard drive to another.
    >
    > I'm using the /y switch to suppress the prompt when I'm overwriting an
    > existing file.
    >
    > This seems rather wasteful and inefficient - why copy the same file
    > over itself?
    >
    > Is there a way to make it so if the file exists then it won't copy the
    > file?



    I can't remember if xcopy has an update switch off the bat, but pkzip
    certainly has. If you want speed, use PKZIP, set compression to zero,
    and set the update flag ...

    xcopy /? yields the /m switch - this turns the archive flag of the file
    off when it is copied and only copies files with the bit set: that
    should do the trick -- provided your applications reset the archive bit
    when a file has been altered and is being saved back.

    h.t.h. -Peter
    Peter Huebner, Dec 1, 2003
    #3
  4. C

    MarkH Guest

    (C) wrote in news::

    >
    > I've got a simple batch file which I use to backup my files from one
    > hard drive to another.
    >
    > I'm using the /y switch to suppress the prompt when I'm overwriting an
    > existing file.
    >
    > This seems rather wasteful and inefficient - why copy the same file
    > over itself?
    >
    > Is there a way to make it so if the file exists then it won't copy the
    > file?


    Which operating system?

    If you type: XCOPY /? Do you get this option:

    /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 is what I get from the xcopy in WinXP.


    --
    Mark Heyes (New Zealand)
    See my pics at http://homepages.ihug.co.nz/~markh/
    "There are 10 types of people, those that
    understand binary and those that don't"
    MarkH, Dec 1, 2003
    #4
  5. C

    John Guest

    On Mon, 1 Dec 2003 21:14:14 +0000 (UTC), MarkH <>
    wrote:
    get a copy of Robocopy, Xcopy on steriods...
    It use to be on the NT resource kit....
    >This is what I get from the xcopy in WinXP.
    John, Dec 1, 2003
    #5
  6. C

    Shannon Guest

    On Mon, 01 Dec 2003 07:34:17 GMT, (C) wrote:

    >
    >I've got a simple batch file which I use to backup my files from one
    >hard drive to another.
    >
    >I'm using the /y switch to suppress the prompt when I'm overwriting an
    >existing file.
    >
    >This seems rather wasteful and inefficient - why copy the same file
    >over itself?
    >
    >Is there a way to make it so if the file exists then it won't copy the
    >file?
    >



    If you're on WIndows NT, 2000 or above, look for a tool called
    "Robocopy" from Microsoft. It copyies only files with different
    dates and times, and can even delete files from the target that no
    longer exist in the source.
    Shannon, Dec 2, 2003
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?V2FsdGVyIEx1YmVsbA==?=

    Dos 6.22 XCopy command is not working properly

    =?Utf-8?B?V2FsdGVyIEx1YmVsbA==?=, Dec 30, 2003, in forum: Microsoft Certification
    Replies:
    0
    Views:
    900
    =?Utf-8?B?V2FsdGVyIEx1YmVsbA==?=
    Dec 30, 2003
  2. Lance Malish

    Not sure I'm doing Xcopy right....

    Lance Malish, Jul 12, 2003, in forum: Computer Support
    Replies:
    2
    Views:
    679
    Lance Malish
    Jul 12, 2003
  3. Jack Gillis

    Xcopy help please

    Jack Gillis, Jul 17, 2007, in forum: Computer Support
    Replies:
    10
    Views:
    4,563
    Jordon
    Jul 18, 2007
  4. Tanel Kagan

    xcopy help

    Tanel Kagan, Dec 12, 2007, in forum: Computer Support
    Replies:
    2
    Views:
    1,399
    John Holmes
    Dec 12, 2007
  5. iROK

    Help with xcopy

    iROK, Jan 9, 2008, in forum: Computer Support
    Replies:
    21
    Views:
    1,650
    Aardvark
    Jan 17, 2008
Loading...

Share This Page