File Copy...

M

Mamun Shaheed

Hi, I need to copy some files from one directory to
another say from c:\abc to d:\xzy
This is a regular job. c:\abc folder contains new files
and existing files as well. I want to copy only new
files. I wrote following script..

@Echo Off
c:
cd abc

for %%f in (*.*) do echo %%f >> list.txt

d:
cd xyz
for %%f in (*.*) do (
type c:\abc\list.txt | FIND %%f >> %%g
if %%g == "" copy %%g d:\xyz
)

Echo on

but it is not working...

how can i match my current directories file names with a
file containing list of file name..

~M$
 
W

Wilfried Hennings

Mamun Shaheed said:
Hi, I need to copy some files from one directory to
another say from c:\abc to d:\xzy
This is a regular job. c:\abc folder contains new files
and existing files as well. I want to copy only new
files.

C:
cd \abc
FOR %%X IN (*.*) DO IF NOT EXIST D:\xzy\%%X COPY %%X D:\xzy


--
email me: change "nospam" to "w.hennings"
Wilfried Hennings c./o.
Forschungszentrum (Research Center) Juelich GmbH, MUT
<http://www.fz-juelich.de/mut/index.php?index=3>
All opinions mentioned are strictly my own, not my employer's.
 
T

Tom Lavedas

Also ...

replace c:\abc\*.* d:\xzy\ /A

For more info type REPLACE/? at a command prompt.

Tom Lavedas
===========
 
J

Jerold Schulman

[call] CopyNew SourceFolder DestinationFolder [/V] [Mask1] [Mask2] [Maskn]

See the script at tip 7639 in the 'Tips & Tricks' at http://www.jsiinc.com


Hi, I need to copy some files from one directory to
another say from c:\abc to d:\xzy
This is a regular job. c:\abc folder contains new files
and existing files as well. I want to copy only new
files. I wrote following script..

@Echo Off
c:
cd abc

for %%f in (*.*) do echo %%f >> list.txt

d:
cd xyz
for %%f in (*.*) do (
type c:\abc\list.txt | FIND %%f >> %%g
if %%g == "" copy %%g d:\xyz
)

Echo on

but it is not working...

how can i match my current directories file names with a
file containing list of file name..

~M$


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top