R
Rich Pasco
XCOPY is a powerful utility with many options, but there are
two things I can't figure out how to do.
First:
Is there an XCOPY option to copy from folder 1 to folder 2 just
those files which do not already have a namesake in folder 2?
This would be the dual of /U which copies just those files
which do already exist. I am currently using /-Y and holding
down the "n" key, but there must be a better way.
Second:
Is there an XCOPY option to delete from folder 2 those files
which do not exist in folder 1? I am currently using this:
pushd folder2
for %%f in (*.*) do if not exist folder1\%%f del %%f
popd
Can anyone suggest a better way?
Thanks in advance,
- Rich
two things I can't figure out how to do.
First:
Is there an XCOPY option to copy from folder 1 to folder 2 just
those files which do not already have a namesake in folder 2?
This would be the dual of /U which copies just those files
which do already exist. I am currently using /-Y and holding
down the "n" key, but there must be a better way.
Second:
Is there an XCOPY option to delete from folder 2 those files
which do not exist in folder 1? I am currently using this:
pushd folder2
for %%f in (*.*) do if not exist folder1\%%f del %%f
popd
Can anyone suggest a better way?
Thanks in advance,
- Rich