47

How do I list folders and files using the PowerShell tree command? Is it possible to color format the output for distinct files and folders?

2
  • 1
    Similar to stackoverflow.com/questions/27447014/… Nov 20, 2017 at 9:11
  • 4
    See tree /?. "/F Display the names of the files in each folder." As for colors, superuser isn't a script writing service. If you're stuck with a specific problem and post your code, people here would love to help you.
    – root
    Nov 20, 2017 at 14:23

2 Answers 2

63

Simply use tree /F on any powershell instance to have the same behavior the normal tree on UNIX has.

The tree alone on Powershell shows only folders but not files in them.

1
  • @SeñorCMasMas your comment has nothing to do here
    – serge
    Jul 26, 2022 at 13:18
6
TREE Drive:\path /F

If command prompt or power shell are not recognizing 'tree', then:

Go to environment variables and change both the user variables and system variables "Path" to C:\Windows\System32 (Mine is C:\Windows\System32 ,Find yours using %systemroot%\System32)

Then open a new power shell and give the above command. EX: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.