Creating a Hierarchy Map of Your Hard Drive

Written by Allen Wyatt (last updated August 12, 2019)

4

As you start storing things on a hard drive, the structure of that drive can quickly become quite complex. You can end up with directories within directories within directories. If you want to create a "roadmap" that shows you the hierarchy of your hard drive, there's an easy way to do it.

  1. Display a command-prompt window. (In Windows 7 and Windows 10, click the Start button, type CMD, and press Enter. In Windows 8, press Win+C, click the Search icon, type CMD, and press Enter.)
  2. Type the following two command lines, pressing Enter at the end of each:
  3. cd \
    tree /a /f > mydrive.txt
    
  4. Close the command-prompt window.

Doesn't seem like much, does it? The first command line changes to the root directory for your hard drive. The second one generates a "tree" of your hard drive structure and stores the output in the file named mydrive.txt. This file was created in the root directory for the hard drive, and you can use Windows Explorer (Windows 7 and Windows 8) or File Explorer (Windows 10) to navigate to that directory and open the file.

If you don't want a hierarchy for your entire hard drive, you can limit what is generated by the TREE command. You do this by using command-prompt commands, in step 2, to navigate to the directory you want to use as the beginning point for the hierarchy. The mydrive.txt file is then created in that directory (instead of the root directory), and it contains only the hierarchy of the current directory and any subdirectories.

 This tip (10054) applies to Windows 7, 8, and 10.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Viewing Your Entire Document Width

The Zoom tool is very useful to help you see all of your document information. Here's how to make sure you can see all ...

Discover More

Leading Spaces in Document File Names

If you try to add spaces to the beginning of a document's file name, Word normally strips them away. This tip examines ...

Discover More

Adding Horizontal Lines at the Sides of a Word

Want to add a couple of horizontal lines at the sides of a word? It can be trickier than it sounds, but there are several ...

Discover More
More WindowsTips

Using Robocopy to Copy Entire Directories

It's simple to use Robocopy to copy entire directories. Dealing with directories is what it does best! This tip shows you ...

Discover More

Using Sync Center

Sync Center is a centralized place where you can deal with your offline files. You can do a manual sync, set up a sync ...

Discover More

Creating a CD/DVD Archive

CDs and DVDs are good for creating archives of files you want to keep over the long term. They are a great way to back up ...

Discover More
Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 - 6?

2019-08-20 05:30:36

roy taylor

Thanks Peter, will try it out.

Roy


2019-08-18 22:47:32

Peter Moran

Roy,

Windows does not like you loading files into the root directory unless in Admin mode I suspect.

Change the command so that it goes into your documents file:

tree /a /f > C:\Users\Yourname\Documents\mydrive.txt

Mind you it produces a heap of information about your hard drive!

I am still trying to find what I was looking for!


2019-08-14 09:49:01

MIchael Armstrong

Many free utilities to do this. Wish I could remember the name of the one I use...


2019-08-13 05:50:08

roy Taylor

I tried this but keep getting ACCESS DENIED, any ideas why?


Newest Tips