How MS-DOS 6.22 TREE Displays Directories
The TREE command in MS-DOS 6.22 is an external
command-line utility used to generate a visual, hierarchical diagram of
the folders on a disk. This article explains how the command renders
directory levels on the screen, how it handles branch structures, and
how its primary switches—/F and /A—alter the
displayed output.
Default Visual Structure
When executed without parameters, the TREE command
displays the directory structure of the current drive and working
directory. It represents folder hierarchies using IBM Extended ASCII
box-drawing characters (Code Page 437).
Subdirectories branch out from their parent folders using vertical lines, horizontal lines, and corner connectors. Each subsequent level of nesting is indented to the right, showing parent-child relationships clearly:
- A vertical line indicates a path continuing to deeper or adjacent folders.
- A tee connector branches off to a sibling folder.
- A corner connector indicates the last subdirectory within a given branch.
By default, the command ignores files completely and displays only the directory names.
Command Syntax and Targeting
The basic syntax for the utility in MS-DOS 6.22 is:
TREE [drive:][path] [/F] [/A]
If a drive letter or specific directory path is provided (for
example, TREE C:\DOS), the command begins rendering from
that specified root or directory rather than the current working
path.
Displaying Files with the
/F Switch
To view both the directory layout and the files contained within each
directory, the /F switch is used:
TREE C:\ /F
When this flag is active, TREE lists all files located
in a folder immediately below that folder's name before rendering any
subordinate directories. The filenames are indented under the folder
header, preserving the visual flow of the tree while giving a complete
file listing.
Changing Character
Sets with the /A Switch
MS-DOS 6.22 includes the /A switch to replace Extended
ASCII line-drawing symbols with standard 7-bit ASCII characters:
TREE /A
When /A is specified, the graphical lines are converted
to basic characters:
- Hyphens (
---) represent horizontal branches. - Backslashes (
\) represent terminal branches. - Plus signs (
+) represent intermediate branching nodes. - Vertical bars (
|) represent vertical continuity lines.
This mode is designed primarily for redirecting tree output to legacy printers, serial terminals, or non-IBM compatible displays that cannot render high-order ASCII box characters correctly.
Managing Long Outputs
Because the TREE command outputs its diagram
continuously to standard output, viewing large directory structures on a
standard 80x25 character display often causes the output to scroll off
the screen. To control this, users typically pipe the output through the
MORE filter:
TREE C:\ /F | MORE
Alternatively, the output can be redirected to a text file for review in the MS-DOS Editor:
TREE C:\ /F /A > DIRLIST.TXT