How to Print a Tree View of an Archive in Windows
I recently had the need to print out the directory structure of an archive for some documentation. Actually the archive is a Word Doc which, using the Office Open XML specification is actually a collection of XML files which can be viewed in a archive tool such as 7-zip. This is useful for analysis of malicious word documents without actually opening up the document itself.
7-zip doesn’t have a tree view natively so I couldn’t take a screenshot, and I wanted to demonstrate the file structure in my writeup.
Both Linux and Windows have the tree command which will output a folder structure. In this example I will focus on the Windows version of the command so the flags are different than in Linux. By default tree only shows folders. If you want to also get file names you need to use the /F flag.
tree /F <folder>
Tree won’t recognize a document as something containing subfolders so I extracted it to temporary location and ran the tree command on it to generate my ASCII structure.
References
http://mama.indstate.edu/users/ice/tree/tree.1.html
https://ss64.com/nt/tree.html