copy files

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
ladduq
Posts: 31
Joined: 22 Jan 2012 01:08

copy files

#1 Post by ladduq » 05 Mar 2013 07:31

I have a file adapter.txt in 100 different locations(paths).and i am trying to copy althose instances of adapter.txt to a new location(path)


I have written like this

copy C:\myfile\one\adapter.txt C:\Newpath
copy C:\myfile\two\adapter.txt C:\Newpath
copy C:\myfile\three\adapter.txt C:\Newpath
copy C:\myfile\four\adapter.txt C:\Newpath
copy C:\myfile\five\adapter.txt C:\Newpath
.
.
.
.
.
.
.
.
.
copy C:\myfile\hundred\adapter.txt C:\Newpath


However it copies only one instance of adapter.txt instead of all 100 instances
since the file name is only same name of all 100 instances adapter.txt

pls suggest.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: copy files

#2 Post by foxidrive » 05 Mar 2013 07:37

Add a random number to each filename, but you need to check that it hasn't been used before.

Or use xcopy and the /s switch to create the folder structure too.

Post Reply