copy DIR to TXT file

T

Tony

Hi folks,

I used to be able to do this in DOS so easily but I
haven't used DOS in sooo long I've forgotten how!

All I want to do is copy file names from a directory to a
text file so then I can import those file names into an
Excel spreadsheet.

How do I get the dir file names into a text file?

Thanks
 
R

Ramesh [MVP]

Tony,

How to add the Print Directory feature for folders in Windows XP:
http://support.microsoft.com/?kbid=321379

--
Ramesh, Microsoft MVP
Windows XP Shell/User
http://windowsxp.mvps.org


Hi folks,

I used to be able to do this in DOS so easily but I
haven't used DOS in sooo long I've forgotten how!

All I want to do is copy file names from a directory to a
text file so then I can import those file names into an
Excel spreadsheet.

How do I get the dir file names into a text file?

Thanks
 
W

Will Denny

Hi

You can re-direct to a text file with the following command:

dir > dir.txt

naming the text file whatever you want and saving it in whichever folder you
want to.

--


Will Denny
MS-MVP Windows Shell/User
Please reply to the News Groups
 
W

Will Denny

Some of the good old DOS commands come in handy at times.

--


Will Denny
MS-MVP Windows Shell/User
Please reply to the News Groups
 
B

Bruce Chambers

Tony said:
Hi folks,

I used to be able to do this in DOS so easily but I
haven't used DOS in sooo long I've forgotten how!

All I want to do is copy file names from a directory to a
text file so then I can import those file names into an
Excel spreadsheet.

How do I get the dir file names into a text file?

Thanks


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



C:\>dir /?
Displays a list of files and subdirectories in a directory.

DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]
[/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4]

[drive:][path][filename]
Specifies drive, directory, and/or files to list.

/A Displays files with specified attributes.
attributes D Directories R Read-only files
H Hidden files A Files ready for archiving
S System files - Prefix meaning not
/B Uses bare format (no heading information or summary).
/C Display the thousand separator in file sizes. This is the
default. Use /-C to disable display of separator.
/D Same as wide but files are list sorted by column.
/L Uses lowercase.
/N New long list format where filenames are on the far right.
/O List by files in sorted order.
sortorder N By name (alphabetic) S By size (smallest first)
E By extension (alphabetic) D By date/time (oldest first)
G Group directories first - Prefix to reverse order
/P Pauses after each screenful of information.
/Q Display the owner of the file.
/S Displays files in specified directory and all subdirectories.
/T Controls which time field displayed or used for sorting
timefield C Creation
A Last Access
W Last Written
/W Uses wide list format.
/X This displays the short names generated for non-8dot3 file
names. The format is that of /N with the short name inserted
before the long name. If no short name is present, blanks are
displayed in its place.
/4 Displays four-digit years

Switches may be preset in the DIRCMD environment variable. Override
preset switches by prefixing any switch with - (hyphen)--for example, /-W.

--

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
 
T

Thomas Wendell

Like DEL, when a file says is in use by another process (in Win Explorer)
but deletes fine in CMD-prompt...


--
Tumppi
Reply to group
=================================================
Most learned on nntp://news.mircosoft.com
Helsinki, Finland (remove _NOSPAM)
(translations from FI/SE not always accurate)
=================================================
 
P

Pop

....

Yes, but you know, this and many other like it should have been
in windows from the 3.0 days and onward; Many people never heard
of DOS but still have all the same problems DOS served so well
and so simply. I've often wondered why.

Pop
 
P

Pop

....

Huh! That is so wonderfully simple I am simply AMAZED at how
stupid I am! I never even came close to thinking about doing it
that way! I mean, I come from way back when and CP/M and the
whole shot, and should have known!
How quickly we forget old friends, sometimes. I particularly
like the cmd method because it doesn't put more rubbish in the
right click menues.

KUDOS!!

Pop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top