Sign in with
Sign up | Sign in
Your question

copy DIR to TXT file

Last response: in Windows XP
Share
December 20, 2004 1:11:43 AM

Archived from groups: microsoft.public.windowsxp.basics (More info?)

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

More about : copy dir txt file

Anonymous
December 20, 2004 9:40:14 AM

Archived from groups: microsoft.public.windowsxp.basics (More info?)

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


"Tony" <anonymous@discussions.microsoft.com> wrote in message
news:0db501c4e65a$c761d860$a301280a@phx.gbl...
> 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
December 20, 2004 9:40:15 AM

Archived from groups: microsoft.public.windowsxp.basics (More info?)

Doh!

It's been a few years.

Thanks, Will

Man do I miss the simplicity of DOS!

Tony

>-----Original Message-----
>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
>
>
>"Tony" <anonymous@discussions.microsoft.com> wrote in
message
>news:0db501c4e65a$c761d860$a301280a@phx.gbl...
>> 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
>
>
>.
>
Related resources
Anonymous
December 20, 2004 10:13:06 AM

Archived from groups: microsoft.public.windowsxp.basics (More info?)

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


"Tony" <anonymous@discussions.microsoft.com> wrote in message
news:0dcc01c4e662$a18ccfc0$a301280a@phx.gbl...
> Doh!
>
> It's been a few years.
>
> Thanks, Will
>
> Man do I miss the simplicity of DOS!
>
> Tony
>
>>-----Original Message-----
>>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
>>
>>
>>"Tony" <anonymous@discussions.microsoft.com> wrote in
> message
>>news:0db501c4e65a$c761d860$a301280a@phx.gbl...
>>> 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
>>
>>
>>.
>>
Anonymous
December 20, 2004 10:52:25 AM

Archived from groups: microsoft.public.windowsxp.basics (More info?)

Tony wrote:
> 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:
http://dts-l.org/goodpost.htm
http://www.catb.org/~esr/faqs/smart-questions.html

You can have peace. Or you can have freedom. Don't ever count on having
both at once. - RAH
December 20, 2004 11:48:00 AM

Archived from groups: microsoft.public.windowsxp.basics (More info?)

Don't forget Karen's Directory Printer, a nice little free app.
http://www.karenware.com/powertools/ptdirprn.asp

--

Kenny



"Will Denny" <willdenny@mvps.org> wrote in message
news:%23BlXTNm5EHA.3336@TK2MSFTNGP11.phx.gbl...
> 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
>
>
> "Tony" <anonymous@discussions.microsoft.com> wrote in message
> news:0dcc01c4e662$a18ccfc0$a301280a@phx.gbl...
> > Doh!
> >
> > It's been a few years.
> >
> > Thanks, Will
> >
> > Man do I miss the simplicity of DOS!
> >
> > Tony
> >
> >>-----Original Message-----
> >>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
> >>
> >>
> >>"Tony" <anonymous@discussions.microsoft.com> wrote in
> > message
> >>news:0db501c4e65a$c761d860$a301280a@phx.gbl...
> >>> 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
> >>
> >>
> >>.
> >>
>
>
Anonymous
December 20, 2004 2:57:03 PM

Archived from groups: microsoft.public.windowsxp.basics (More info?)

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


"Tony" <anonymous@discussions.microsoft.com> wrote in message news:0db501c4e65a$c761d860$a301280a@phx.gbl...
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
December 20, 2004 2:57:04 PM

Archived from groups: microsoft.public.windowsxp.basics (More info?)

That's not exactly what I was looking for but I did add
that capability to my folder options.

Thanks!

Tony

>-----Original Message-----
>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
>
>
>"Tony" <anonymous@discussions.microsoft.com> wrote in
message news:0db501c4e65a$c761d860$a301280a@phx.gbl...
>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
>.
>
Anonymous
December 21, 2004 3:58:45 AM

Archived from groups: microsoft.public.windowsxp.basics (More info?)

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)
=================================================



"Will Denny" <willdenny@mvps.org> kirjoitti viestissä
news:%23BlXTNm5EHA.3336@TK2MSFTNGP11.phx.gbl...
> 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
>
>
> "Tony" <anonymous@discussions.microsoft.com> wrote in message
> news:0dcc01c4e662$a18ccfc0$a301280a@phx.gbl...
> > Doh!
> >
> > It's been a few years.
> >
> > Thanks, Will
> >
> > Man do I miss the simplicity of DOS!
> >
> > Tony
> >
> >>-----Original Message-----
> >>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
> >>
> >>
> >>"Tony" <anonymous@discussions.microsoft.com> wrote in
> > message
> >>news:0db501c4e65a$c761d860$a301280a@phx.gbl...
> >>> 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
> >>
> >>
> >>.
> >>
>
>
December 21, 2004 12:34:36 PM

Archived from groups: microsoft.public.windowsxp.basics (More info?)

Will Denny wrote:
>> Some of the good old DOS commands come in handy at times.
>>
>> --
....

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
December 21, 2004 12:40:09 PM

Archived from groups: microsoft.public.windowsxp.basics (More info?)

Bruce Chambers wrote:
>> Tony wrote:
....
>> 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:
....

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
!