copy but not over-write

  • Thread starter Thread starter Jack B
  • Start date Start date
J

Jack B

I have two folders with over 1000 photo files, and most of the files are the
same, except in folder A, the files have the EXIF data, but not in folder B.

Folder B has slightly more files. How do I copy from B to A
1) without over-writing any files
AND
2) without getting the pop-up that says "Do you want to over-write the file"
for every single file?

In other words, I would like to copy from B just the files that A does not
have.


Jack
 
I have two folders with over 1000 photo files, and most of the files are the
same, except in folder A, the files have the EXIF data, but not in folder B.

Folder B has slightly more files. How do I copy from B to A
1) without over-writing any files
AND
2) without getting the pop-up that says "Do you want to over-write the file"
for every single file?

In other words, I would like to copy from B just the files that A does not
have.
Download XXCOPY at www.XXCOPY.com . It's free for personal use (and 40
I think for 2 busilness licenses) and does this and any other kind of
copy you want to do. It runs in a DOS box. There's a Yahoo list
called XXCOPY where even the author participates regularly among
others if you need help to figure it out. Indeed, the only problem is
that it can do so many things the right parameter can get be hard to
find the first time.

Set it up in a .bat file so you know exactly what you're going to say
and can say it again with no change.

If you take out nospam, you can write me and I'll help you figure out
the parms for this.
 
Jack B said:
I have two folders with over 1000 photo files, and most of the files are
the
same, except in folder A, the files have the EXIF data, but not in folder
B.

Folder B has slightly more files. How do I copy from B to A
1) without over-writing any files
AND
2) without getting the pop-up that says "Do you want to over-write the
file"
for every single file?

In other words, I would like to copy from B just the files that A does not
have.


Jack

This little batch file will do it:
@echo off
set Source=c:\Documents and Settings\Jack\My Pics\Folder1
set Targ=c:\Documents and Settings\Jack\My Pics\Folder2
for %%a in ("%Source%\*.*") do (
if not exist "%Targ%\%%~na%%~xa" echo copy "%%a" "%Targ%"
)

Note this:
- Do not retype the code - use copy and paste instead.
- Replace my folder names with actual names.
- Test the code, then remove the word "echo" in the last
line to activate it.
 
Thanks for the info folks -- I'll give it a try and let you know.


Jack

--------------------------------------------------------------------
 
This looked the easiest, but I couldn't get it to work. It copied Folder2
into Folder1 as one large bit file with no extension.

Jack

----------------------------------------



Jack B said:
I have two folders with over 1000 photo files, and most of the files are
the
same, except in folder A, the files have the EXIF data, but not in folder
B.

Folder B has slightly more files. How do I copy from B to A
1) without over-writing any files
AND
2) without getting the pop-up that says "Do you want to over-write the
file"
for every single file?

In other words, I would like to copy from B just the files that A does not
have.


Jack

This little batch file will do it:
@echo off
set Source=c:\Documents and Settings\Jack\My Pics\Folder1
set Targ=c:\Documents and Settings\Jack\My Pics\Folder2
for %%a in ("%Source%\*.*") do (
if not exist "%Targ%\%%~na%%~xa" echo copy "%%a" "%Targ%"
)

Note this:
- Do not retype the code - use copy and paste instead.
- Replace my folder names with actual names.
- Test the code, then remove the word "echo" in the last
line to activate it.
 
Of course -- here is the file which I named CopyNotSame.bat:

@echo off
set Source=c:\datamore\test
set Targ=c:\datamore\test\test1
for %%a in ("%Source%\*.*") do (if not exist "%Targ%\%%~na%%~xa" copy "%%a"
"%Targ%")


Jack
 
Jack said:
I have two folders with over 1000 photo files, and most of the
files are the same, except in folder A, the files have the EXIF
data, but not in folder B.

Folder B has slightly more files. How do I copy from B to A
1) without over-writing any files
AND
2) without getting the pop-up that says "Do you want to over-write
the file" for every single file?

In other words, I would like to copy from B just the files that A
does not have.

Yeah - reading everything and seeing your efforts thusfar - I second the
vote for SyncToy.

SyncToy 2.1
http://www.microsoft.com/downloads/details.aspx?FamilyID=C26EFA36-98E0-4EE9-A7C5-98D0592D8C52

"SyncToy 2.1 is a free application that synchronizes files and folders
between locations. Typical uses include sharing files, such as photos, with
other computers and creating backup copies of files and folders."

SyncToy forums:
http://social.microsoft.com/Forums/en-US/synctoy/threads

Some information:
http://www.microsoft.com/prophoto/downloads/synctoybeta.aspx

And yes - it can do exactly what you asked and it can even keep doing it
(including renames, etc) if need be (or it can be a one-time thing.)
 
The batch file works perfectly well, provided that you undo any line wrap
that your newsreader might have created. Here it is again, this time with
line numbers so that you can see exactly where each line starts. Note that
Line 5 is a long line. Remove the numbers before running the file.

[1] @echo off
[2] set Source=c:\datamore\test
[3] set Targ=c:\datamore\test\test1
[4] for %%a in ("%Source%\*.*") do
[5] (if not exist "%Targ%\%%~na%%~xa" copy "%%a" "%Targ%"
[6] )
 
I keep getting "the syntax of the command is incorrect"


Jack

----------------------------------


The batch file works perfectly well, provided that you undo any line wrap
that your newsreader might have created. Here it is again, this time with
line numbers so that you can see exactly where each line starts. Note that
Line 5 is a long line. Remove the numbers before running the file.

[1] @echo off
[2] set Source=c:\datamore\test
[3] set Targ=c:\datamore\test\test1
[4] for %%a in ("%Source%\*.*") do
[5] (if not exist "%Targ%\%%~na%%~xa" copy "%%a" "%Targ%"
[6] )
 
Sorry, I made a mistake in a last-minute correction. Here it is again.
[1] @echo off
[2] set Source=c:\datamore\test
[3] set Targ=c:\datamore\test\test1
[4] for %%a in ("%Source%\*.*") do (
[5] if not exist "%Targ%\%%~na%%~xa" copy "%%a" "%Targ%"
[6] )


Jack B said:
I keep getting "the syntax of the command is incorrect"


Jack

----------------------------------


The batch file works perfectly well, provided that you undo any line wrap
that your newsreader might have created. Here it is again, this time with
line numbers so that you can see exactly where each line starts. Note that
Line 5 is a long line. Remove the numbers before running the file.

[1] @echo off
[2] set Source=c:\datamore\test
[3] set Targ=c:\datamore\test\test1
[4] for %%a in ("%Source%\*.*") do
[5] (if not exist "%Targ%\%%~na%%~xa" copy "%%a" "%Targ%"
[6] )


Jack B said:
Of course -- here is the file which I named CopyNotSame.bat:

@echo off
set Source=c:\datamore\test
set Targ=c:\datamore\test\test1
for %%a in ("%Source%\*.*") do (if not exist "%Targ%\%%~na%%~xa" copy
"%%a"
"%Targ%")


Jack
 
Okay, I finally got it, but not before discovering a snafu of eye-mind
coordination -- the sub directory under Test is 1, not Test 1 -- ha -- I was
going to send you a couple of screen shots when I saw the mistake!

Thanks.


Jack

-----------------------------------


Sorry, I made a mistake in a last-minute correction. Here it is again.
[1] @echo off
[2] set Source=c:\datamore\test
[3] set Targ=c:\datamore\test\test1
[4] for %%a in ("%Source%\*.*") do (
[5] if not exist "%Targ%\%%~na%%~xa" copy "%%a" "%Targ%"
[6] )


Jack B said:
I keep getting "the syntax of the command is incorrect"


Jack

----------------------------------


The batch file works perfectly well, provided that you undo any line wrap
that your newsreader might have created. Here it is again, this time with
line numbers so that you can see exactly where each line starts. Note that
Line 5 is a long line. Remove the numbers before running the file.

[1] @echo off
[2] set Source=c:\datamore\test
[3] set Targ=c:\datamore\test\test1
[4] for %%a in ("%Source%\*.*") do
[5] (if not exist "%Targ%\%%~na%%~xa" copy "%%a" "%Targ%"
[6] )


Jack B said:
Of course -- here is the file which I named CopyNotSame.bat:

@echo off
set Source=c:\datamore\test
set Targ=c:\datamore\test\test1
for %%a in ("%Source%\*.*") do (if not exist "%Targ%\%%~na%%~xa" copy
"%%a"
"%Targ%")


Jack
 
As you can see in my 13 Dec 5:46 pm post, the .bat file worked for me.
But now I'm curious -- how is Shift key + No Button applied in a copy
function?


Jack
 
Back
Top