Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CMD line copy without overwriting

Status
Not open for further replies.

dh42891

Technical User
Oct 7, 2003
107
US
I have about 1500 files taking up about 50 gigs of space. Unfortunately, it seems I may not have copied all the files from their original location. Is there a copy command I can run that will not overwrite? I know I can specify a flag that will tell windows to automatically overwrite, but I only want to copy the files that are not there. Obviously I don't want to click "no" everytime windows asks me if I want to replace an existing file. Thanks,

dylan
 
Hi, Dylan

Create a little text file on your hard drive containing nothing but the letter N followed by a carriage return, and call it nono.txt or something. Put it in a folder other than the ones involved in the copy.

Then code your copy command as:

copy c:\fromdir\*.* d:\destdir <nono.txt

That way the N's get supplied by nono.txt.

Jock
 
dylan,

you may want to use robocopy. it comes with the resource kits for win nt/2k/xp/2k3 and is extremely useful for mirroring entire directory structures, while not overwriting data already present, when configured with its available switches.

-thefourthwall
 
What does a 'carriage return' look like?

dylan
 
Or a traditional solution:

1.- Make destination files read only
2.- use xcopy sourcefiles destinationdirectory /c /y

Cheers,
Dian
 
Jock,

that's a rather elegant solution, i think that'd work rather nicely.

-thefourthwall
 
Hi, Dylan

'Carriage return' means hit the enter key.

For example, use Notepad, type N, hit enter and save the file as 'nono.txt' to use my previous example.

Jock

"DOS Lives!"
 
you can also write a vbs to loop through your source files, and then check to see ifexists in the destination folder, if it exists, not to write that file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top