?
Solved

copying files

Posted on 2013-06-30
4
Medium Priority
?
150 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 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

My purpose is to describe the basic concepts of virtual memory as implemented in a modern Windows-based operating system. I will also describe the problems inherent in older systems and how virtual memory solves them. The dark ages - before virtu…
Many times while working on a computer regardless of any Operating System, lag and crashes seem to creep in, hindering your working speed. Sometimes, it can also cause your work to be lost unexpectedly and as a result, you are unable to meet your de…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

765 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