Computing.Net > Forums > Programming > Copy files only out of folders

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Copy files only out of folders

Reply to Message Icon

Name: bri17
Date: April 25, 2004 at 09:49:56 Pacific
OS: XP Home
CPU/Ram: p4/512
Comment:

Hi. I have a deep directory tree. for example:
c:\0001
c:\0002
c:\0003
c:\0004

These folders have files in them that start with D and others that start with T.

Does anyone know how I can copy all of the files that start with T?

I've tried xcopy c:\000\t*.* c:\test\*.* /s but this copies the folders\subfolders as well. I just want to end up with all of the files in one folder. Anyone have any ides?

By the way. I am just looking for dos commands or maybe suggestions for utilities that are out there. (I do not know programming)

Each folder may have a few sub folders so I am looking to see if anyone has any suggestions besides writing a batch file to go into each and every folder.




Sponsored Link
Ads by Google

Response Number 1
Name: dtech10
Date: April 26, 2004 at 15:32:46 Pacific
Reply:

Hi
Try something like this

@echo off
dir /b ad *.* | find "000" > dirs.txt
for /f %%a in (dirs.txt) do copy c:\%%a\t*.* c:\all\


0

Response Number 2
Name: bri17
Date: April 27, 2004 at 15:35:36 Pacific
Reply:

worked perfectly. thanks to you dtech10


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Can't Install Visual Stud... Nav - ruins your hard dri...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Copy files only out of folders

copy files only with a particular name www.computing.net/answers/programming/copy-files-only-with-a-particular-name/19939.html

Copying of files only if file count is met www.computing.net/answers/programming/copying-of-files-only-if-file-count-is-met/20159.html

Out Of Memory error in .NET app www.computing.net/answers/programming/out-of-memory-error-in-net-app/13212.html