List architecture of all files in a folder

13. September 2020 Uncategorized 0

Familiar with exception BadImageFormatException? Yeah, that still happens as not everyone compiles with Any CPU and when you get one of those, in a service that has like 200 files, you find yourself struggling to understand which exactly file (or files) are not in the suitable architecture (aka bitness). When I got it and began going one-by-one I quickly realized that this will be not the last time I have this problem (although not the first time either) and it will take me ages to pinpoint the exact dll.

So I decided to write something to automate the process. Started with a PowerShell script, but quickly became unreadable with all that binary files parsing and .NET reflection. Then I switched to a simple console application, written in C# .NET. The result is: ArchiShow!

The exe can be downloaded from releases page on GitHub, usage is rather simple (at least for version 1.0):

Without any parameters, the exe will output to console a list of all .exe and .dll files in the current folder. So it is easy just to copy it to target and run from command line like this:

ArchiShow.exe > _files.csv

There is an optional parameter to say which folder to scan: -p or –path, like this:

ArchiShow.exe -p "C:\My Folder"

That’s it!

Project page
Download


Leave a Reply

Your email address will not be published. Required fields are marked *