how to prevent overwrite in xcopy command

I am excuting xcopy command in ipl to copy dcrs from a folder to teamsite

I do not want to overwrite the dcrs if it already exist in team site

in xcopy command /U is used to overwite the existing files

is there anything which will do exactly opposite of that? /-U does not work

pls can anybody reply as soon as possible?
thanks in advance

Comments

  • I am excuting xcopy command in ipl to copy dcrs from a folder to teamsite

    I do not want to overwrite the dcrs if it already exist in team site

    in xcopy command /U is used to overwite the existing files

    is there anything which will do exactly opposite of that? /-U does not work

    pls can anybody reply as soon as possible?
    thanks in advance
    Which OS you are using?

    In Windows 2000, /-Y will prompt to confirm before overwriting a file...
  • Which OS you are using?

    In Windows 2000, /-Y will prompt to confirm before overwriting a file...
    thanks for reply

    yes I agree with you but it prompts for confirmation when I run the command from command prompt

    when i run a script then it directly overwrites the existing file.
  • thanks for reply

    yes I agree with you but it prompts for confirmation when I run the command from command prompt

    when i run a script then it directly overwrites the existing file.
    Can't you use MSBACKUP or MWBACKUP.. ??
  • I am excuting xcopy command in ipl to copy dcrs from a folder to teamsite

    I do not want to overwrite the dcrs if it already exist in team site

    in xcopy command /U is used to overwite the existing files

    is there anything which will do exactly opposite of that? /-U does not work

    pls can anybody reply as soon as possible?
    thanks in advance
    There is a way to accomplish what you are asking for. The secret is to play with the attribute parameter (/M). You need to set X-copy to only copy the files that have the archive attribute and set the attribute to off once the files are copied.

    So, when you 1st copy your files all the A-Archive attribute will be turned off. New files and modified files will automatically have the A-Archive attribute ON. Next time you run the same command only these files will be copied.

    Hope that helps.
  • There is a way to accomplish what you are asking for. The secret is to play with the attribute parameter (/M). You need to set X-copy to only copy the files that have the archive attribute and set the attribute to off once the files are copied.

    So, when you 1st copy your files all the A-Archive attribute will be turned off. New files and modified files will automatically have the A-Archive attribute ON. Next time you run the same command only these files will be copied.

    Hope that helps.
    Alternatively, write the entire thing in Perl and you can do whatever you want with regard to testing the status of existing files before copying over other files (or directories) - it's not really that difficult a thing to do - and a good exercise if you want to improve your Perl skills....
TeamSite Developer Resources

  • Docker Automation

  • LiveSite Content Services (LSCS) REST API

  • Single Page Application (SPA) Modules

  • TeamSite Add-ons

If you are interested in gaining full access to the content, you can register for a My Support account here.
image
OpenText CE Products
TeamSite
APIs