Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

copy multiple files w/out combining

2,135 views
Skip to first unread message

Terry B.

unread,
Aug 19, 2004, 8:14:43 PM8/19/04
to
It's common knowledge how to copy several files into another
directory, while concatenating those files. BUT can someone please
tell me how, with MS-DOS (v.5.1.2600) how to copy multiple files into
another directory without combining them? Thanks in advance [:-)
Terry B.

tls...@concentric.net

unread,
Aug 19, 2004, 11:46:45 PM8/19/04
to
On 19 Aug 2004 17:14:43 -0700, ripra...@comcast.net (Terry B.) took
a very strange rock and inscribed these words:

>It's common knowledge how to copy several files into another
>directory, while concatenating those files. BUT can someone please
>tell me how, with MS-DOS (v.5.1.2600) how to copy multiple files into
>another directory without combining them?

While in the same directory where the files are, type
copy *.* <destination directory path>

you can substitute the file extension for the star if trying to copy
specific types of files while leaving some untouched.

If you're in a different directory, you'll need to type the full
directory path name starting with the drive letter in addition to the
*.* etc.

ie. copy c:/dir/subdir/subsubdir/*.* <destination>

--
Therese Shellabarger / The Roving Reporter - Civis Mundi
tls...@concentric.net / http://tlshell.cnc.net/

Terry B.

unread,
Aug 20, 2004, 7:01:52 PM8/20/04
to
tls...@concentric.net wrote in message news:<1nsai0h28coh77hj2...@4ax.com>...

>
> While in the same directory where the files are, type
> copy *.* <destination directory path>
>
> you can substitute the file extension for the star if trying to copy
> specific types of files while leaving some untouched.
>
> If you're in a different directory, you'll need to type the full
> directory path name starting with the drive letter in addition to the
> *.* etc.
>
> ie. copy c:/dir/subdir/subsubdir/*.* <destination>

TO tlshell:
Maybe I'm, like, unbelievably dense, but it seems like you're
making the huge assumption that the files which are to be copied into
another directory are THE ONLY FILES in their present directory.
Knowwhutahmean? I mean, sure you can use wildcards to 'scoop up' all
the files in a directory, but what if you're in the root of C:\ drive,
for example, and there are a 100 files in there, but you only want to
copy 3 or four of them into another directory? Assume that there are 2
files you want to copy, "example1.txt" & "example2.txt", and that
they're at present in "C:\", and that you'd like to copy them to
"C:\new folder"....If you are already in C:\, what exactly is the
syntax to use to copy them??? I've been trying this at the prompt:
copy "example1.txt" "example2.txt" "c:\new folder". And windows keeps
telling me that the syntax is incorrect. Can you help???

Randolf Richardson

unread,
Aug 21, 2004, 5:21:28 AM8/21/04
to
"ripra...@comcast.net (Terry B.)" wrote in comp.os.msdos:

To copy specific files you'll need to use a FOR loop. I'll assume,
for the purpose of this example, that there are a few patterns in addition
to a few specific filenames, and that the destination path is C:/DEST/.

C:
MD \Dest
CD \Source
For %X in (*.arj ap??.dbf license.dat) do Copy %X C:\Temp\Dest

Within a "For" loop you can include any number of filenames or file
patterns, each delimited by a space. The variable "%X" can actually be any
letter of the alphabet.

Try the following command for another example of the "For" command:

For %X in (0 1 2 3 4 5 6 7 8 9) do Echo Number %X!!!

When using the "For" command in a batch file, you'll need to use two
percent signs instead of one (e.g., "%X" will have to be changed to "%%X").

I hope this is helpful to you.

--
Sir Randolf, noble spam fighter - r...@8x.ca
Vancouver, British Columbia, Canada

Please do not eMail me directly when responding to
my postings in the newsgroups.

Sending eMail to other SMTP servers is a privilege.

Terry B.

unread,
Aug 21, 2004, 7:35:45 PM8/21/04
to
Randolf Richardson <r...@8x.ca> wrote in message news:<Xns954C18D8...@24.64.223.211>...

> "ripra...@comcast.net (Terry B.)" wrote in comp.os.msdos:
<snip>

> To copy specific files you'll need to use a FOR loop. I'll assume,
> for the purpose of this example, that there are a few patterns in addition
> to a few specific filenames, and that the destination path is C:/DEST/.
>
> C:
> MD \Dest
> CD \Source
> For %X in (*.arj ap??.dbf license.dat) do Copy %X C:\Temp\Dest
>
> Within a "For" loop you can include any number of filenames or file
> patterns, each delimited by a space. The variable "%X" can actually be any
> letter of the alphabet.
>
> Try the following command for another example of the "For" command:
>
> For %X in (0 1 2 3 4 5 6 7 8 9) do Echo Number %X!!!
>
> When using the "For" command in a batch file, you'll need to use two
> percent signs instead of one (e.g., "%X" will have to be changed to "%%X").
>
> I hope this is helpful to you.

TO SIR RANDOLPH:
Thanks very much [:-) That's just what I was looking for!

Terry B.

tls...@concentric.net

unread,
Aug 22, 2004, 12:13:22 AM8/22/04
to
On 20 Aug 2004 16:01:52 -0700, ripra...@comcast.net (Terry B.) took

a very strange rock and inscribed these words:

>Assume that there are 2


>files you want to copy, "example1.txt" & "example2.txt", and that
>they're at present in "C:\", and that you'd like to copy them to
>"C:\new folder"....If you are already in C:\, what exactly is the
>syntax to use to copy them??? I've been trying this at the prompt:
>copy "example1.txt" "example2.txt" "c:\new folder". And windows keeps
>telling me that the syntax is incorrect. Can you help???

literally, copy e*.txt c:\new folder

No quotes

Otherwise for dissimilar names, type: copy example1.txt c:\new folder

Repeat as needed.

Randolf Richardson

unread,
Aug 22, 2004, 4:24:15 AM8/22/04
to

You're welcome.

Please don't hesitate to post any other questions.

0 new messages