Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get a list of all directories and sub directories 5

Status
Not open for further replies.

nissan240zx

Programmer
Jun 26, 2005
280
0
0
US
Hello All,
I am trying to extract list of all the directories and their sub-directories. I dont neccesarrily want the files within the folder but jst the folder and sub folder name.

Is there an easier/simpler way to get this.
Please advice..

A good programmer is someone who looks both ways before crossing a one-way street. - Doug Linder
 
goto a command prompt (Start->run->cmd)

type :
cd\
dir *. /s /a >DirectoryTree.txt

open up the file in wordpad/notepad.

done!
 

I allways use the following so I can suck it into Excel.

goto a command prompt (Start->run->cmd)

dir /s /b /ad>c:\DirectoryTree.txt

for remote server

dir \\SERVER\c$ /s /b /ad>C:\SERVERFOLDERS.TXT

Did a multi server migration with 40,000+ folders that way.



 
Depending on what you hope to do with it, I would either use any of the suggestions above or vbscript or if you want to know permissions on the folders too use XCACLS.

I hope you find this post helpful.

Regards,

Mark
 
I tried the tool Outonalimb mentioned and it works super

A good programmer is someone who looks both ways before crossing a one-way street. - Doug Linder
 
Agree that 'JR Directory Printer' is interesting

IMVHO more useful is use DIRLIST.BAT from
'FilePath' in file context menu
and
'FlieList' in folder context menu

DIRLIST.BAT file
echo off
rem file://C:\WINDOWS\system32\DIRLIST.BAT
dir %1 /s /-p /o:gn /b > "%temp%\Ltd{$%date:~8,2%%date:~10,4%}"
start /w edxor.exe "%temp%\Ltd{$%date:~8,2%%date:~10,4%}"
del "%temp%\Ltd{$%date:~8,2%%date:~10,4%}"
echo on

BTW metapad & edxor are used as notepad repleacement

so both mentioned registry settings

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\Shell\CMD1]
@="FilePath"
[HKEY_CLASSES_ROOT\*\Shell\CMD1\Command]
@="C:\\WINDOWS\\system32\\DIRLIST.BAT \"%1\""

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\FileList]
[HKEY_CLASSES_ROOT\Directory\shell\FileList\command]
@="C:\\WINDOWS\\SYSTEM32\\DIRLIST.BAT \"%1\
 
The good old DOS command TREE /F > file will provide a "semi-graphical" version of the output. Hope this helps.
 
Excellent suggestions from everyone. Thsi is what the tek-tips forum is all about.
Superb advice people..just amazing...

A good programmer is someone who looks both ways before crossing a one-way street. - Doug Linder
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top