Solved

Retrieve file extensions from folder structure (recursive)?

Posted on 2010-09-06
3
526 Views
Last Modified: 2012-05-10
I've a folder structure starting from c:\data and need to know all FILE EXTENSIONS used, recursively? Rgds
0
Comment
Question by:go4java
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Expert Comment

by:DavidGerald
ID: 33609879
A bit vague, why recursively?

Is it because you need to get a list of all files with extention of type A, then another list of all extentions type B, then type C etc?  Or do you just need a list of files with ordered by extention?
 Do you just need to know what extentions there are and how many?

0
 

Author Comment

by:go4java
ID: 33609923
..yes, I need a list of all file extensions and they I will have extract certain file types.
I just found a way with Total Commander, sleceting all file types *.* and retrieving all exztensions ftom that list. Thnaks
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 500 total points
ID: 33610131
How about this batch file.  It will keep a running count of all files.  remove the line

  echo %%~xA, !%%~xA!

to stop the progress details and speed it up somewhat...

Steve

@echo off
setlocal enabledelayedexpansion
cd /d c:\data
for /F "tokens=*" %%A in ('dir /a-d /b /s *.*') do (
  set /A %%~xA=!%%~xA! + 1
  echo %%~xA, !%%~xA!
)
set . > extensions.txt
endlocal
START notepad extensions.txt

You end up with something like this in a text file in Notepad:


.bat=11
.bmp=2
.cmd=233
.csv=5
.db=1
.exe=3
.htm=7
.html=2
.jpg=3
.js=4
.lnk=1
.mbf=1
.php=1
.prn=3
.reg=2
.sep=1
.sk=1
.txt=36
.vbs=46
.xls=1
.zip=1

0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question