English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How to create a list of all directories in a system. This is really close

for /r %%x in (*) do echo %%x >> textfile.txt

However it creates a list of all files and their directory paths in a system. I want a list of all directories. I want each directory to be recorded only once.

thanks.

2007-04-23 16:12:03 · 6 answers · asked by Netiad 2 in Computers & Internet Programming & Design

6 answers

Here's one way to do that,

dir \ /s /b /ad > textfile.txt

"\" = start from the root directory
"/s" = get all subdirectories
"/b" = bare information, just names
"/ad" = just get directories

2007-04-27 02:22:05 · answer #1 · answered by Kevin 7 · 5 0

2

2016-07-23 07:55:37 · answer #2 · answered by ? 4 · 0 0

try from the c:\ prompt

dir *. >dirlist.txt

Folders do not have an extension to their name, therefore *. will show wildcard DOT entries in the drive

the file is parsable in a program if need be, as I've done it once before. you may also use any of the DIR command switches. the > directs the output to the file named.

2007-04-23 16:21:54 · answer #3 · answered by Jeffrey F 6 · 0 0

Do

for /r /d

and then the rest.

You do know you can type for /? for a list of switches, right?

Any DOS command with a /? will usually give you a list of options.

2007-04-23 16:23:11 · answer #4 · answered by Amanda H 6 · 0 0

Paid Surveys At Home : http://OnlineSurveys.uzaev.com/?yvlB

2016-07-10 03:18:44 · answer #5 · answered by ? 3 · 0 0

How about this simple DOS command:

c:\dir /a:d /s /b >>textfile.txt

2007-04-23 16:21:04 · answer #6 · answered by Bohdan 2 · 0 0

fedest.com, questions and answers