Batch file question.

Discussion in 'General Off-Topic Chat' started by test84, Nov 9, 2007.

  1. test84
    OP

    test84 GBAtemp's last ninja 2.

    Member
    3,685
    3
    Sep 8, 2006
    Iran
    Iran, Tehran.
    what is defualt NO for an xcopy command?
    like xcopy f:\ c:\ -n
    so it will just copy newer files, thnx.
     
  2. PuyoDead

    PuyoDead Hey! Hey! Oh!

    Member
    698
    1
    May 5, 2003
    United States
    Cincinnati, OH
    If you mean so that it will only copy files that are "newer" than their previous files, then use -d

    Normally, you'd use -d:date to copy anything newer than a certain date, but just using -d will overwrite anything that has a newer version than the file where it is being copied to. Anything that is the same file will be skipped.
     
  3. test84
    OP

    test84 GBAtemp's last ninja 2.

    Member
    3,685
    3
    Sep 8, 2006
    Iran
    Iran, Tehran.
    thnx for ur answer.
    that didnt work.
    since it asks everytime to overrite a file or not and seems that its logic is not working too.

    i want oppsite of /y switch, to use it to suppress the asking and copy whatever is newer on my flash disk and copy things are not on disk.

    p.s. hope u dont ever get lost in translation.
     
  4. PuyoDead

    PuyoDead Hey! Hey! Oh!

    Member
    698
    1
    May 5, 2003
    United States
    Cincinnati, OH
    First off, I meant to use /d not -d. Sorry, dumb error that. I'm not sure what you're using it for, but here's what I made a batch file for.

    When I insert my MicroSD card, the menu that windows gives has the top option of backing up my saves. What it does, it copies every *.sav file on the card to a directory on my computer. If the file already exists, it only overwrites it if the save on my card is newer than the backup on my computer. Otherwise, it skips it.

    Here's what's in my batch file:

    xcopy /S /I /Y /D \*.sav C:\NDS\R4\Saves\Joe

    This might help for switches and such. http://support.microsoft.com/kb/289483