Directory Listing into notepad

  • Thread starter Thread starter luke
  • Start date Start date
L

luke

I have a directory without 800 folders inside. Is there a simple way I can
get a listing of the contents into this format in a text editor?

folder1,
folder2,
folder3,
folder4,
folder5,
etc etc
 
luke said:
I have a directory without 800 folders inside. Is there a simple way I can
get a listing of the contents into this format in a text editor?

folder1,
folder2,
folder3,
folder4,
folder5,
etc etc

Of course there is.

Head into a new Command Prompt, navigate to the root directory (the
place where "Folder1, Folder2, etc..." are located) then type the "tree"
command. This will display the whole tree. You might want to redirect
the output to a text file directly, so try something like this:
"tree > file.txt"
 
IOpen up a command prompt in the folder

dir * /b /ad >filename.txt

dir /?
for other possibilities for listings

Jon
 
luke said:
I have a directory without 800 folders inside. Is there a simple way I can
get a listing of the contents into this format in a text editor?

folder1,
folder2,
folder3,
folder4,
folder5,
etc etc

Or.
You can get the free Directory Printer {which will save to disk} from:
http://www.karenware.com/powertools/powertools.asp

You can add the Directory Printer feature for Windows XP:


How to add the Print Directory feature for folders in Windows XP



http://support.microsoft.com/?id=321379





Don
 
Jon said:
IOpen up a command prompt in the folder

dir * /b /ad >filename.txt

dir /?
for other possibilities for listings

Jon

that works great, thanks. Do you have any idea how I can add the "," after
each listing? in my example
 
luke said:
that works great, thanks. Do you have any idea how I can add the "," after
each listing? in my example

After creating the first file, filename.txt, you could try

for /f "delims=\" %i in (filename.txt) do @echo %i, >>filename2.txt

Jon
 
After creating the first file, filename.txt, you could try

for /f "delims=\" %i in (filename.txt) do @echo %i, >>filename2.txt

Jon, sorry to bother you again. But do you think you could do one for this?

"folder1",
"folder2",
"folder3",
"folder4",
"folder5",

many thanks
 
luke said:
I have a directory without 800 folders inside. Is there a simple way I can
get a listing of the contents into this format in a text editor?

folder1,
folder2,
folder3,
folder4,
folder5,
etc etc


From the command prompt (Start > Run > Cmd.exe), simply change to
the desired directory and type "dir > filelist.txt" or "dir > lpt1,"
just as you used to do in DOS. Any of the switches for the DIR command
(type "dir /?") will work with this command, if you wish to modify the
output. You can then subsequently edit the resulting text file using
NotePad, WordPad, Word, etc.

Alternatively:

HOW TO Add a Print Directory Feature for Folders in Windows XP
http://support.microsoft.com/?kbid=321379



--

Bruce Chambers

Help us help you:



You can have peace. Or you can have freedom. Don't ever count on having
both at once. - RAH
 
You could use "for" command instead:

c:\windows> for %i in (*.*) do @echo %i, >>c:\temp\foobar.txt

- that lists all normal (not hidden or system) files from c:\windows to file
c:\temp\foobar.txt and there is comma after each line
- "for %i in (*.*) do" is the basically same as "dir /b *.*"
- after "do" could be any command you want to execute for each found file
- the "%i" represents one found file
- command "echo %i," displays current filename with comma to screen
- @ before echo menas that the command itself is not printed to output
- ">>" redirects output to file appending end of file. With ">" you would
get only last matched file's name
- more help with "for /?"
 
Back
Top