Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extract files from folders 2

Status
Not open for further replies.

dbadmin

Programmer
Jan 3, 2003
147
US
Hi,

I have multiple folders and sub folders from which I need to extract all files with extension .log. Is there any command which could be used on command prompt to do that?

Thanks in advance,
dbadmin
 
The use of the word "extract" indicates a compression tool, which the rest of your question does not indicate...so what does "extract" mean in a literal sense here? Locate the files, copy them, what? That would be a good thing to know to help you.

dir /s *.log would be a great start in locating them. Doing things with them would be tougher, however.

----------
Measurement is not management.
 
Hi Glenn9999,

Thanks for the quick reply. I just need to copy all the files with .log extension from a specific folder and other subfolders in it. There is no compressed archive in this scenario. Sorry for the confusion.

Thanks,
dbadmin.
 
Do a Search of the parent folder (and sub-folders) for the file type *.log.

Copy and paste OR MOVE the files found to a new folder location.



 
something like:

for /r c:\ %i in (*.log) do copy %i e:\temp


Adjust the source path c:\ and destination path e:\temp accordingly, and if using this in a batch file, use %%i in place of the the %i
 
Thank You! Linney and Freestone.

dbadmin.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top