#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Location
    Warsaw
    Posts
    46
    Rep Power
    29

    TREE of the whole system


    Is it possible to implement a tree of all drives and partitions with one command in the cmd.exe?

    Code:
    TREE \
    shows only current drive and
    Code:
    TREE *:\
    doesn't exist.
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,143
    Rep Power
    9398
    Not sure how with cmd.exe, but with PowerShell you can using Get-PSDrive.
    Code:
    Get-PSDrive | Where { $_.Provider.Name -eq "FileSystem" } | ForEach { tree $_.Root > Tree$_.txt }
    will create files named "TreeC.txt" for each drive. If you want it all to a single file then
    Code:
    | ForEach { tree $_.Root } > Tree.txt
  4. #3
  5. Automagically Delicious
    Devshed Regular (2000 - 2499 posts)

    Join Date
    May 2004
    Location
    127.0.0.2 - I live next door.
    Posts
    2,202
    Rep Power
    2737
    Yes
    Code:
    C:\> dir /S
    Adam TT
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Location
    Warsaw
    Posts
    46
    Rep Power
    29
    Originally Posted by AdamPI
    Yes
    Code:
    C:\> dir /S
    Covers only c:\ drive as well as
    Code:
     C:\>  dir C:..\ /s
    command.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    3
    Rep Power
    0
    Its possible, but it ain't pretty.

    Code:
    for %i in (c d e f g h i j k l m n o p q r s t u v w x y z) do @dir %i:\>Nul 2>&1 && @tree /f /a %i:\>%i.drive.txt
    To view the resulting files (ctrl+c to quit)...
    Code:
    more ?.drive.txt
    To consolidate the files...
    Code:
    type ?.drive.txt>>drives.txt

IMN logo majestic logo threadwatch logo seochat tools logo