List folders and subfolders cmd

0

I would like to display the directory name followed by the folders that are inside it in order.

I tested the command:

dir /s /b /o:g /ad

And the output was generated like this:

C:\Users\JG\Pictures\Animes
C:\Users\JG\Pictures\Series
C:\Users\JG\Pictures\Nova pasta
C:\Users\JG\Pictures\Series\Teen Wolf

But I wish it were generated like this:

C:\Users\JG\Pictures\Animes
C:\Users\JG\Pictures\Series
C:\Users\JG\Pictures\Series\Teen Wolf
C:\Users\JG\Pictures\Nova pasta

Does anyone know of any command or attribute that does this?

    
asked by anonymous 20.09.2017 / 16:47

2 answers

2

Updated - when using sort set as desired:

dir /a:d /s /b | sort
    
20.09.2017 / 17:11
2

You can try the command without the colon (":"), see:

dir /s /b /OG /AD
    
04.07.2018 / 14:37