How to make Batch file find .txt and copy

January 15, 2011 at 04:44:41
Specs: Windows 7, 12GHZ,12GB DDR5
I need to find all .txt documents on all drives from C:\ D:\ etc... then Copy them to the current directory the .bat was run from.

See More: How to make Batch file find .txt and copy

Report •

January 15, 2011 at 06:10:13
What no answer yet? its been an hour i tougth this was semi-basic stuff, :( any1?

Report •

January 15, 2011 at 07:42:02
Actually your question has been answered any number of times before.

If you do a search ...see top of page will come up with any number of answers.

Hint:xcopy source :\*.txt destination:\dir /D /E /C /R /H /I /K /Y

Report •

January 15, 2011 at 08:23:35
Thanks, but i still got a issue, It retrives Folders, and i only want the txt file from within the folder/subcolder/etc i dont wish the Folders to tagalong the ride if you understand :)

/T /E Creates directory structure, but does not copy files. Does not include empty directories or subdirectories. /T /E includes empty directories and subdirectories. basicly i want the reversed of this :)

Report •

Related Solutions

January 15, 2011 at 08:39:24
It's in the switches. The above hint uses a bunch of them...LOL

To see what each one does...

Report •

January 15, 2011 at 08:52:33
ive read em all non does what i said... not even exlude as you cant exlude a folder, then everything get blacked out, then u tell me the switch cause ive tried about all by now :) non that i find retrives .txt files from a deeptree without brining along the entire Folder Collection aswell and for me to dig through a mile of Folders to find my txt

i think it can be created by using "spiders" (just an idea...)wich enters each'n every folder of the Drive,and execute xcopy indivdually to the desired Folder n after that terminate themselves :)

Report •

Ask Question