Technology Questions

Go Back   Technology Questions > Software Questions > Operating System Questions > Windows XP

Windows XP Discuss the Microsoft Windows XP Operating System

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 08-19-2007, 09:30 AM
Rob
Newsgroup Contributor
 
Posts: n/a
Would like to write batch file to copy all TXT files in a given directory and all subdirectories to a single target directory.

I would like to write a batch file to copy all TXT files in a given
directory and all subdirectories to a single target directory.

This is so that I can select them all at once in an application.

I have used xcopy to make batch files in the past, and I know what to
do if I wanted the tree structure maintained in the target, but I
don't. I want all files to be in a single directory.

Any help most welcome.

Thanks.

Rob

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 08-19-2007, 09:30 AM
  #2 (permalink)  
Old 08-19-2007, 10:50 AM
Pegasus \(MVP\)
Newsgroup Contributor
 
Posts: n/a
Re: Would like to write batch file to copy all TXT files in a given directory and all subdirectories to a single target directory.


"Rob" <f8YRm9@spambobLEAVETHISBITOUT.net> wrote in message
news:j8rgc3h3i9b7umju0rfc69ffk6ksuik1ro@4ax.com...
>I would like to write a batch file to copy all TXT files in a given
> directory and all subdirectories to a single target directory.
>
> This is so that I can select them all at once in an application.
>
> I have used xcopy to make batch files in the past, and I know what to
> do if I wanted the tree structure maintained in the target, but I
> don't. I want all files to be in a single directory.
>
> Any help most welcome.
>
> Thanks.
>
> Rob
>


You could use xxcopy.exe. It has a function called "flatten"
a directory tree. You can download it from a number of
sites.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #3 (permalink)  
Old 08-19-2007, 02:20 PM
Poprivet
Newsgroup Contributor
 
Posts: n/a
Re: Would like to write batch file to copy all TXT files in a given directory and all subdirectories to a single target directory.

Pegasus (MVP) wrote:
> "Rob" <f8YRm9@spambobLEAVETHISBITOUT.net> wrote in message
> news:j8rgc3h3i9b7umju0rfc69ffk6ksuik1ro@4ax.com...
>> I would like to write a batch file to copy all TXT files in a given
>> directory and all subdirectories to a single target directory.
>>
>> This is so that I can select them all at once in an application.
>>
>> I have used xcopy to make batch files in the past, and I know what to
>> do if I wanted the tree structure maintained in the target, but I
>> don't. I want all files to be in a single directory.
>>
>> Any help most welcome.
>>
>> Thanks.
>>
>> Rob
>>

>
> You could use xxcopy.exe. It has a function called "flatten"
> a directory tree. You can download it from a number of
> sites.


There are a couple of revs with bugs; get it from xxcopy.com to be sure of
getting the latest.

Pop`


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #4 (permalink)  
Old 08-19-2007, 06:00 PM
- Bobb -
Newsgroup Contributor
 
Posts: n/a
Re: Would like to write batch file to copy all TXT files in a given directory and all subdirectories to a single target directory.


"Rob" <f8YRm9@spambobLEAVETHISBITOUT.net> wrote in message
news:j8rgc3h3i9b7umju0rfc69ffk6ksuik1ro@4ax.com...
>I would like to write a batch file to copy all TXT files in a given
> directory and all subdirectories to a single target directory.
>
> This is so that I can select them all at once in an application.
>
> I have used xcopy to make batch files in the past, and I know what to
> do if I wanted the tree structure maintained in the target, but I
> don't. I want all files to be in a single directory.
>
> Any help most welcome.
>
> Thanks.
>
> Rob
>

I used to do that long ago -
From DOS prompt: ( Start- Run- CMD )
CD \ ( just so we both assume same thing)
Md newdir
cd newdir
Xcopy/s c:\sourcepath\*.txt *.*
Will copy all *.txt files from source path and subfolders (use C:\ for
entire drive) to C:\newdir using same filenames. Only a problem if dup
filenames. ( /c would be handy to have it keep going even after error)
Also /l or /f may be useful.
===========
From cmd prompt do xcopy/? for syntax/options help. If manual one time,
just cd to that folder first.
===========
Bobb


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #5 (permalink)  
Old 08-19-2007, 10:40 PM
Pegasus \(MVP\)
Newsgroup Contributor
 
Posts: n/a
Re: Would like to write batch file to copy all TXT files in a given directory and all subdirectories to a single target directory.


"- Bobb -" <bobb@noemail.123> wrote in message
news:%231nSIRs4HHA.484@TK2MSFTNGP06.phx.gbl...
>
> "Rob" <f8YRm9@spambobLEAVETHISBITOUT.net> wrote in message
> news:j8rgc3h3i9b7umju0rfc69ffk6ksuik1ro@4ax.com...
>>I would like to write a batch file to copy all TXT files in a given
>> directory and all subdirectories to a single target directory.
>>
>> This is so that I can select them all at once in an application.
>>
>> I have used xcopy to make batch files in the past, and I know what to
>> do if I wanted the tree structure maintained in the target, but I
>> don't. I want all files to be in a single directory.
>>
>> Any help most welcome.
>>
>> Thanks.
>>
>> Rob
>>

> I used to do that long ago -
> From DOS prompt: ( Start- Run- CMD )
> CD \ ( just so we both assume same thing)
> Md newdir
> cd newdir
> Xcopy/s c:\sourcepath\*.txt *.*
> Will copy all *.txt files from source path and subfolders (use C:\ for
> entire drive) to C:\newdir using same filenames. Only a problem if dup
> filenames. ( /c would be handy to have it keep going even after error)
> Also /l or /f may be useful.
> ===========
> From cmd prompt do xcopy/? for syntax/options help. If manual one time,
> just cd to that folder first.
> ===========
> Bobb
>
>


Your command will maintain the existing folder structure.
This is NOT what the OP requires.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #6 (permalink)  
Old 08-20-2007, 06:50 AM
Rob
Newsgroup Contributor
 
Posts: n/a
Re: Would like to write batch file to copy all TXT files in a given directory and all subdirectories to a single target directory.

On Mon, 20 Aug 2007 07:36:39 +0200, "Pegasus \(MVP\)" <I.can@fly.com>
wrote:

>
>"- Bobb -" <bobb@noemail.123> wrote in message
>news:%231nSIRs4HHA.484@TK2MSFTNGP06.phx.gbl...
>>
>> "Rob" <f8YRm9@spambobLEAVETHISBITOUT.net> wrote in message
>> news:j8rgc3h3i9b7umju0rfc69ffk6ksuik1ro@4ax.com...
>>>I would like to write a batch file to copy all TXT files in a given
>>> directory and all subdirectories to a single target directory.
>>>
>>> This is so that I can select them all at once in an application.
>>>
>>> I have used xcopy to make batch files in the past, and I know what to
>>> do if I wanted the tree structure maintained in the target, but I
>>> don't. I want all files to be in a single directory.
>>>
>>> Any help most welcome.
>>>
>>> Thanks.
>>>
>>> Rob
>>>

>> I used to do that long ago -
>> From DOS prompt: ( Start- Run- CMD )
>> CD \ ( just so we both assume same thing)
>> Md newdir
>> cd newdir
>> Xcopy/s c:\sourcepath\*.txt *.*
>> Will copy all *.txt files from source path and subfolders (use C:\ for
>> entire drive) to C:\newdir using same filenames. Only a problem if dup
>> filenames. ( /c would be handy to have it keep going even after error)
>> Also /l or /f may be useful.
>> ===========
>> From cmd prompt do xcopy/? for syntax/options help. If manual one time,
>> just cd to that folder first.
>> ===========
>> Bobb
>>
>>

>
>Your command will maintain the existing folder structure.
>This is NOT what the OP requires.


Thanks to all. xxcopy did the trick.

Rob
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools

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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy file to top level directory Siegfried Heintze Windows Vista 5 08-02-2007 12:30 PM
Setting up a directory and moving a file into that directory from gppnrdrj Windows Vista 4 07-11-2007 05:11 AM
Setting up a directory and moving a file into that directory from gppnrdrj Windows Vista 1 07-11-2007 01:40 AM
Copy multiple files into a single file - xcopy? JornyO Windows XP 8 03-15-2007 01:16 PM
Temp Directory acts like media directory Henry Jones Windows Vista 2 01-20-2007 01:15 PM


New To Technology Questions? Do You Need Help with Your Computer or Device? Do You Need Help with this site?

All times are GMT -8. The time now is 05:08 AM.


2003 - 2009 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0