Solved

copying files

Posted on 2013-06-30
4
146 Views
Last Modified: 2013-10-28
hello,

i am in need of a script to copy a bunch of files from different folders to a single folder, and i would like 2 options if possible: to copy to a different folder, and also to combine into a different file.

i am using windows command line.

this is what i have tried when trying to combine:

copy "E:\deleteme\test1\test1.txt E:\deleteme\test1\test2.txt E:\deleteme\test1\test3.txt E:\deleteme\test1\test4.txt" E:\deleteme\combined\combined.txt

but it failed. (i am very new to command line)

so ideally i am after a simple script i can modify when needed to copy this files from different folders into a single folder.

Regards,
0
Comment
Question by:3lijah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 23

Accepted Solution

by:
Mysidia earned 200 total points
ID: 39288968
the copy command operator to combine two files is  +     (plus symbol)

try:

E:
cd E:\deleteme\test1
copy test2.txt+test3.txt combined.txt
0
 

Author Comment

by:3lijah
ID: 39289002
thanks,

the + worked. as i have about 100+ files to group, is there a cleaner way to do this?

i have found this:

for /f "delims=" %%i in (filelist.txt) do echo D|xcopy "E:\deleteme\%%i" "E:\deleteme\combined\%%i" /i /z /y

(filelist.txt contains:

test1\test1.txt
test2\test2.txt
test3\test3.txt
test4\test4.txt)

however this copies the folders, can this be modified to copy just the files into a folder and/or to combine the files into one file.

Regards,
0
 

Author Comment

by:3lijah
ID: 39607359
I've requested that this question be closed as follows:

Accepted answer: 0 points for 3lijah's comment #a39289002
Assisted answer: 200 points for Mysidia's comment #a39288968

for the following reason:

this was not the exact answer i was looking for, but thanks.
0
 

Author Closing Comment

by:3lijah
ID: 39607360
thanks, this was on track, but i ahve decided to just use another method. thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: I have always been a big fan of Windows but my liking towards it is slowly being eroded by the variety of other Applications that I encounter, when I browse the Web. Most of the software available is free and maybe Open Source too. …
When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question