Menu

file list

There was a day when I was searching for some files inside a directory which had multiple sub-directories. Of course there is a Windows search tool that can help you to some extent but – it will not allow you to view multiple directories at the same time while highlighting files of particular kind – this is what I wanted.
Below there is a powershell script that does exactly that listing directory content and creating a html file to let you see and (in some cases) easily open files.

Each file is displayed as a tile like this one:

On each tile there is a filename, file size and date of last modification.

The web page generated will look like this:

Tiles are grouped as they appear in directories. They have different colors – based on their extensions. In my case the black ones are txt files, yellow ones are html/htm files, violet ones are pdfs and pictures of common types are purple. The rest are displayed as gray.
The files that have colors other than gray can be opened in the browser by clicking on a tile. Most browsers do not support opening files like docx and others just by clicking on the url pointing at particular file. And the reason for this is that browser do not know a protocol that could handle such file. Thankfully you can create your own protocol but i will show it some other time.

For now you can open txt, cpp, c, hpp, h, gif, tiff, jpg, jpeg, png, bmp, pdf, html, htm files from the web page generated by the script.
File size is displayed in either Bytes, KiloBytes or MegaBytes – if the size is bigger than 1024 Bytes it will be shown in KiloBytes.
You can easily modify the script to add your coloring preference just by creating or altering a CSS style.