PC Review


Reply
Thread Tools Rate Thread

Copy files form several directories to One

 
 
=?Utf-8?B?TWlrZQ==?=
Guest
Posts: n/a
 
      3rd Jun 2004
Hi;

I want to search a directory tree for all the *.txt files and copy them to a TXT directory.
I do NOT wish to copy the existing directory tree to the TXT directory. I have tried robocopy
and Xcopy, but they both recreate the Directory tree.

Any help would be appreciated.

M
 
Reply With Quote
 
 
 
 
Phil Robyn [MVP]
Guest
Posts: n/a
 
      3rd Jun 2004
Mike wrote:

> Hi;
>
> I want to search a directory tree for all the *.txt files and copy them to a TXT directory.
> I do NOT wish to copy the existing directory tree to the TXT directory. I have tried robocopy
> and Xcopy, but they both recreate the Directory tree.
>
> Any help would be appreciated.
>
> M


From the CMD prompt:

for /f "tokens=*" %a in ('dir /s /b *.txt') do @echo copy "%a" \TXT

In a batch file, use '%%a' instead of '%a'.

--
Phil Robyn
Univ. of California, Berkeley

u n z i p m y a d d r e s s t o s e n d e - m a i l
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying JPEG image files to new directories makes directories unus =?Utf-8?B?U2ltb24gUC4=?= Windows XP Help 0 29th Jan 2007 02:21 AM
Batch File to copy directories Jay Windows XP General 10 21st Oct 2005 06:54 PM
copy files animation in form? Lars Netzel Microsoft VB .NET 1 28th May 2005 11:45 AM
Copy and Pasting large directories Ray Harris Windows XP Help 0 29th Nov 2003 10:21 AM
How to copy directories using a wildcard Patrick Microsoft Windows 2000 CMD Promt 1 5th Nov 2003 09:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:27 AM.