Display the contents of a folder

  powerless 21:28 21 Apr 04

How do you display the contents of a folder through a command prompt?

...and have the results sent to a text file?

Windows XP.

This has been posted on here before but cannot find it.

  paddyjack 21:53 21 Apr 04

try here click here

  QuickHare 22:03 21 Apr 04

The simplest way is to use the command DIR. To use it to display filenames, use

DIR *.* /B

and to send this to a file, use a redirection. So the full command to use is

DIR *.* /B >path\file.ext

  paddyjack 22:20 21 Apr 04

glasses need cleaning


is right but .ext should be .txt, no doubt you realised that

  DAG88 22:40 21 Apr 04

does .ext stand for any file extension?

  powerless 22:43 21 Apr 04

Thats works :)


How would I get it to display the same file extensions together? As at the moment there all scrmabled together.

vbs. red, zip

  paddyjack 22:50 21 Apr 04

I think you will find one file one type so it would be DIR *.vbs /B >path\file.txt etc, but the other option might be arrange your folder by type

  paddyjack 22:55 21 Apr 04


the command as DIR *.* /B >path\file.ext, should be DIR *.* /B >path\file.txt to make a text file, the file extension is DIR *.* (list all files, and all extensions)it could equally be DIR *.mp3 (that would be all mp3 files).

  QuickHare 20:41 23 Apr 04

My notation (and commands) expanded a bit:

DIR = Short for Directory listing
*.* = Finds all files
/B = BARE FORMAT switch to make a list only
> = Redirects output to the following place
path\ = Path, may include drive.
file = Any FILEname
.ext = Any EXTension.

Sorry if this confused.

  QuickHare 20:44 23 Apr 04

DIR *.* /B /OE >path\file.txt

The /OE orders by Extension. N is by name, S is by size, D is by date, G groups directories (folders) first and putting - in reverses the order. You can use any you want in any order.

  Boluwd 21:12 23 Apr 04

to my postings

This thread is now locked and can not be replied to.

Nintendo Switch (Nintendo NX) release date, price, specs and preview trailer: Codename NX console…

1995-2015: How technology has changed the world in 20 years

8 things designers (and brands) need to know about the modern woman

How to speed up a slow Mac: 19 great tips to make an iMac, MacBook or Mac mini run faster | Speed…