Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Xcopy: How do you NOT over write existing files (skip existing files).

Posted on 2007-04-25
10
Medium Priority
?
31,264 Views
Last Modified: 2012-08-13
I am trying to copy some files into the %SYSTEMROOT%\system32 folder.

I DO NOT want to over write any existing files (skip existing files).

I need to include this command in a batch files.  I have gone through all the xcopy commands, but there does not seem to be one, how the heck do i do this??!!!

All machines that this command will be run on are on XP.
0
Comment
Question by:mcompton69
  • 2
  • 2
  • 2
  • +4
10 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18972079
use robocopy instead:
http://www.ss64.com/nt/robocopy.html

/XO
0
 
LVL 8

Accepted Solution

by:
Timoros earned 100 total points
ID: 18972110
Unless you use it with the /-y (Prompts to confirm that you want to overwrite an existing destination file).
As far as i know with /d[:mm-dd-yyyy] it copies source files changed on or after the specified date only. If you do not include a mm-dd-yyyy value, xcopy copies all Source files that are newer than existing Destination files. This command-line option allows you to update files that have changed.
Check out this link too:
http://www.brown.edu/Departments/Psychology/documentation/backup.html
0
 
LVL 3

Expert Comment

by:Gatelodge
ID: 18972547
Or xcopy /-y which will prompt you to overwrite. Ok for a few files but if you have loads its a pain, but safe.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 4

Assisted Solution

by:Dark720
Dark720 earned 100 total points
ID: 18973772
IF NOT EXIST %DESTINATION% XCOPY %SOURCE% %DESTINATION%

0
 
LVL 1

Author Comment

by:mcompton69
ID: 18974201
Thanks all for your help.  Sorry i can only split points between 2 of you because minimum points total is 20 so i have rewarded the 2 that are most relevent to me.
0
 
LVL 4

Expert Comment

by:Dark720
ID: 18974481
no problem, glad to assist.
0
 

Expert Comment

by:TheFunPolice
ID: 25782922
had to post, this topic should have been really easy but i dont like any answers anywhere until i found below:



echo n|xcopy "source\*.*" "destination\*.*" /d/i/e

i use this to backup a folder and all subfolders but only files that do not already exist in the backup. useful for multimedia backup (ie, files themselves will never change)

it will 'ask' about overwriting an existing file but we pipe the n character to the stream and tell it to only copy files that dont already exist =)
0
 
LVL 7

Expert Comment

by:concretesailors
ID: 25843184
'n' is not recognized as an internal or external command, operable program or batch file. - that's what I get when I try to "pipe the n character"


n|xcopy "\\dhssqlcc\R$\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\KinderTrack Backups\*
.bak"
0
 

Expert Comment

by:TheFunPolice
ID: 25843309
concretesailors: it doesn't appear you are issuing the echo call

echo n|xcopy "\\dhssqlcc\R$\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\KinderTrack Backups\*
.bak"
0
 
LVL 7

Expert Comment

by:concretesailors
ID: 25843364
oh, you are correct.
I wasn't using the echo call. Thank you.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
IF you are either unfamiliar with rootkits, or want to know more about them, read on ....
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question