I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe
This article was inspired by a recent question
here at Experts Exchange. In response to that, I wrote a "quick-and-dirty" script that performs the function requested by the Original Poster, but it has numerous shortcomings. This article describes a major revision of that script, which addresses the shortcomings in the original one.
The objective is to report a count of the files, for each file type (file extension), in a folder and all of its subfolders. In addition, the report should contain the total size of all files for each file type. Example:
I wrote the original "quick-and-dirty" script in AutoHotkey
, an excellent (free!) programming/scripting language. The quick explanation for installing AutoHotkey is to visit its website
. A more comprehensive explanation is to read my EE article, AutoHotkey - Getting Started
. After installation, AutoHotkey will own the AHK
file type, supporting the solution discussed in the remainder of this article.
The new script improves upon the previous one in the following ways:
The original script hard-codes the name of the source folder. The new script provides a standard Windows "Browse for Folder" dialog that allows the user to navigate to the folder (or type or copy/paste the folder name).