Windows 11 can print a directory tree by running the tree command in Command Prompt, saving the output as a text file, and printing that file from Notepad. The tree command normally displays the hierarchy in the terminal rather than sending it directly to a physical printer.
Use the built-in command when the printout must reflect an actual folder on disk. If you already have a list of relative file paths, a browser-based path transformer can instead turn that list into deterministic text without accessing the folder.

Print the hierarchy from Command Prompt
Follow these steps to create a text file that contains the directory hierarchy and then send it to a printer or PDF printer.
- Open the Start menu, search for Command Prompt, and launch it. Replace C:\Projects\MyApp in the examples below with the folder you want to list.
- Run tree /F /A "C:\Projects\MyApp" > "%TEMP%\directory-tree.txt". The /F option includes file names, /A uses ASCII branch characters, and the redirection saves the command output instead of displaying it in the terminal. The %TEMP% folder is a convenient writable destination; you can replace it with another existing folder.
- Open the saved file with notepad "%TEMP%\directory-tree.txt". If you chose a different output location, open that file instead.
- In Notepad, press Ctrl+P, select the printer or an available PDF printer, choose the page range and number of copies, and then select Print. If branches wrap awkwardly on the page, landscape orientation or a smaller font can make the hierarchy easier to read.
The command may appear to produce no visible output because everything after the redirection sign is written to the text file. Open that file before attempting to print it.
Control what appears in the printout
The available switches determine whether the tree contains folders only or folders and files, and which characters draw its branches.
| Goal | Command example | Result |
|---|---|---|
| List the current folder | tree | Shows the current directory hierarchy without file names. |
| List a named folder | tree "C:\Projects\MyApp" | Shows that folder and its subfolders. |
| Include file names | tree /F "C:\Projects\MyApp" | Shows both directories and files. |
| Use plain ASCII branches | tree /A "C:\Projects\MyApp" | Replaces extended branch characters with ASCII equivalents. |
| Prepare a complete ASCII listing | tree /F /A "C:\Projects\MyApp" | Combines file inclusion with ASCII output. |
The /F switch changes what is listed, while /A changes how the branches are drawn. Redirect either version to a file when you need paper or a PDF rather than console output.
Build a tree from pasted relative paths
When your source is a known list of relative paths, Directory Tree Generator can turn that list into a structured text tree. It does not enumerate a Windows folder, read local files, or confirm that a typed path exists, so it is not a substitute for tree when the disk itself must be inspected.
- Paste one complete relative file path per line. Keep every path in the run on the same separator style: use forward slashes such as src/lib/parser.ts throughout, or backslashes such as src\lib\parser.ts throughout.
- Choose the input separator that matches your list—forward slash or backslash—and select Unicode or ASCII tree characters. Select Generate tree.
- Review the node count and the full output. Check that the expected parents and children appear, then copy the tree into documentation, an issue, or a code review. If clipboard access is unavailable, the complete output remains visible and selectable for manual copying.
Every input line declares a file, not a directory. Parent directories are inferred from shared prefixes: src/components/Button.tsx and src/index.ts produce one src directory containing a components directory and an index.ts file.
Parsing, validation, sorting, rendering, and clipboard handling happen in the current browser tab. File names and project structure are not uploaded to Lizely or sent to an external API.
Keep the path list valid
Strict validation prevents a typed list from being interpreted in conflicting ways. Fix the reported line and generate again rather than expecting invalid entries to be skipped.
- Keep separators consistent. If forward slash is selected, a backslash anywhere in the run is rejected; the opposite separator is never guessed or silently replaced.
- Use relative paths. Leading separators, Windows drive-root forms, doubled or trailing separators, empty segments, current-directory segments such as ., and parent-traversal segments such as .. are rejected.
- Resolve file-directory conflicts. A standalone src means a file named src. Supplying both src and src/index.ts is therefore rejected because one line declares a file and another requires it to be a directory.
- Remove duplicates and blank lines. Duplicate paths are rejected rather than deduplicated, and every blank line is invalid, including a blank line after the final entry. Normal Windows CRLF line endings are accepted, but embedded control characters and bare carriage returns are rejected.
- Preserve names exactly. Ordinary spaces, dots, leading dots, and letter case remain unchanged. Names are not trimmed, lowercased, slugified, decoded, or renamed, and case variants remain distinct.
Exact size ceilings
- Total input: at most 100,000 UTF-16 code units and 2,000 path lines.
- Path structure: at most 128 segments per path, with at most 255 UTF-16 code units per segment.
- Rendered output: an independent ceiling of 500,000 UTF-16 code units.
Every exact boundary is accepted, while the next unit, entry, segment, or output code unit is rejected. The generator never returns a shortened, sampled, or first-N portion of an oversized result.
Review the generated text before printing
The output begins with a single dot representing the root. Directories are listed before files at each level, and names are ordered by UTF-16 code-unit comparison rather than browser locale, input order, or filesystem metadata. As a result, the same accepted input produces the same output in supported browsers.
- Changing the input, separator, or output style clears the previous tree, error, summary, and copy status, so an old result cannot be mistaken for the current settings.
- Changing between Unicode and ASCII connectors requires another Generate tree action. A failed generation never leaves an earlier successful tree visible.
- Clipboard copying is asynchronous. If permission is denied or unavailable, select the displayed tree manually rather than assuming the copy succeeded.
- A tree can expose internal module names, customer names, deployment layouts, or security-sensitive filenames even though file contents are absent. The generator does not redact those names.
The tool also does not inspect ignore files, label symlinks, calculate sizes, add file comments, discover permissions, or compare the typed list with a real repository. Treat the result as documentation and review it before publishing or printing.
Choose native scanning or list transformation
Use Command Prompt when the printout must reflect what Windows finds on disk. Use the path-list generator when your authoritative source is already a list of relative paths and you need deterministic documentation text. Both approaches can place tree text into Notepad for printing.
| Requirement | Command Prompt tree | Directory Tree Generator |
|---|---|---|
| Source | An actual folder on disk | A pasted relative-path list |
| File inclusion | Add the /F option | Every line represents a file |
| Path existence | Reflects the folder scanned by the command | Cannot verify whether a typed path exists |
| Character style | Use /A for ASCII branches | Choose Unicode or ASCII connectors |
| Best suited to | A physical printout of a real folder | READMEs, issues, reviews, and technical notes |