Copying file names to a document

  • Thread starter Thread starter Tim Meddick
  • Start date Start date
T

Tim Meddick

Copy and paste the following into a text file using notepad, then name
or rename this file with a .bat extension.

(*Tip - In Notepad, if you type the name surrounded by double "quotes"
e.g. "Filename.ext" into the 'Save as...' box, it will save the file as
Filename.ext and not as Filename.ext.txt)

Then place your DirIt.bat file into your 'SendTo' folder, when you send
a folder to this file it will automatically produce a file list for that
folder for you...

------------------- copy between lines -------------------

@echo off
DIR /B %1 > MYLIST.TXT
start /b NOTEPAD MYLIST.TXT
exit

------------------- copy between lines -------------------

==

Cheers, Tim Meddick, Peckham, London. :-)




"Richard Z" wrote in message
news:uR3l$FZ$JHA.2824@TK2MSFTNGP03.phx.gbl...
>I want to make a list of all my files in a folder. Ideally I'd like to
>have a program be able to read the files within a folder so I don't
>have to open up folder after folder but maybe I'm getting ahead of
>myself here. I can right click a file, Rename, Copy and Paste that
>into a document and it will show up perfectly. The problem is I can't
>seem to do that with more than 1 file at a time. I just want the name
>of the file on a list.
 
Richard Z wrote:
> I want to make a list of all my files in a folder. Ideally I'd like to
> have a program be able to read the files within a folder so I don't have
> to open up folder after folder but maybe I'm getting ahead of myself
> here. I can right click a file, Rename, Copy and Paste that into a
> document and it will show up perfectly. The problem is I can't seem to
> do that with more than 1 file at a time. I just want the name of the
> file on a list.


There are a few utility programs available that do this (Karen's
Directory Printer (http://www.karenware.com/powertools/ptdirprn.asp) is
probably the most often cited), but a quick and dirty method is to open
a Command Prompt window and type

dir > dirlist.txt

You can use various switches to control what gets listed. For example,
dir /b /on prints only the names and sorts by name

type dir /? for complete syntax

--
Lem -- MS-MVP

Apollo 11 - 40 years ago this month:
http://www.nasa.gov/mission_pages/apollo/40th/index.html
 
"Richard Z" wrote in message
news:uR3l$FZ$JHA.2824@TK2MSFTNGP03.phx.gbl...
> I want to make a list of all my files in a folder. Ideally I'd like to
> have a program be able to read the files within a folder so I don't have
> to open up folder after folder but maybe I'm getting ahead of myself here.
> I can right click a file, Rename, Copy and Paste that into a document and
> it will show up perfectly. The problem is I can't seem to do that with
> more than 1 file at a time. I just want the name of the file on a list.


You can Google search for file name list programs but you can also use the
dir command for creating a text file with the full path name.

Since I am not on a XP machine I am not sure if one of the DIR switches
below works with XP but it does with Vista. You can type DIR /? and see if
the /b switch is there. If it is it will work on XP. If not leave the
switch off. A little text cleaning would then be needed for a strictly file
name with path list.

Click Start, Run and type CMD then press enter.
Type cd \ and press enter to get back to the root of the system drive (C:\)
Type DIR /s /b >c:\filenames.txt

The DIR command runs a directory listing. The /s switch starts it and runs
through all subdirectories. The /b switch strips off all headers and only
gives the filename and full path. There may be some path names too long for
the DIR command (usually within your system file area such as Live mail
recovery file folder. Otherwise I think this may work for you.

It may create a really large file size so it may not open in some word
editors.
 
After reading the post sent by "Lem", I realise that the I have the and
the /O parameter automatically And inserted on my system. The following
code will not only sort the filenames in alphabetical order, but also
cut out Folder names also....


------------------- copy between lines -------------------

@echo off
DIR /B /ON /A-D %1 > MYLIST.TXT
start /b NOTEPAD MYLIST.TXT
exit

------------------- copy between lines -------------------


==

Cheers, Tim Meddick, Peckham, London. :-)




"Tim Meddick" wrote in message
news:%23oFTvUZ$JHA.1340@TK2MSFTNGP05.phx.gbl...
> Copy and paste the following into a text file using notepad, then name
> or rename this file with a .bat extension.
>
> (*Tip - In Notepad, if you type the name surrounded by double "quotes"
> e.g. "Filename.ext" into the 'Save as...' box, it will save the file
> as Filename.ext and not as Filename.ext.txt)
>
> Then place your DirIt.bat file into your 'SendTo' folder, when you
> send a folder to this file it will automatically produce a file list
> for that folder for you...
>
> ------------------- copy between lines -------------------
>
> @echo off
> DIR /B %1 > MYLIST.TXT
> start /b NOTEPAD MYLIST.TXT
> exit
>
> ------------------- copy between lines -------------------
>
> ==
>
> Cheers, Tim Meddick, Peckham, London. :-)
>
>
>
>
> "Richard Z" wrote in message
> news:uR3l$FZ$JHA.2824@TK2MSFTNGP03.phx.gbl...
>>I want to make a list of all my files in a folder. Ideally I'd like
>>to have a program be able to read the files within a folder so I don't
>>have to open up folder after folder but maybe I'm getting ahead of
>>myself here. I can right click a file, Rename, Copy and Paste that
>>into a document and it will show up perfectly. The problem is I can't
>>seem to do that with more than 1 file at a time. I just want the name
>>of the file on a list.

>
>
 
"Richard Z" wrote in message
news:uR3l$FZ$JHA.2824@TK2MSFTNGP03.phx.gbl...
>I want to make a list of all my files in a folder. Ideally I'd like to
>have a program be able to read the files within a folder so I don't have to
>open up folder after folder but maybe I'm getting ahead of myself here. I
>can right click a file, Rename, Copy and Paste that into a document and it
>will show up perfectly. The problem is I can't seem to do that with more
>than 1 file at a time. I just want the name of the file on a list.


After resolving this issue with the various tips from the other respondents,
have a look at your PC clock. You're posting in the future. Either your
clock is wrong or your PC is set to the wrong time zone.
 
On Sun, 5 Jul 2009 11:56:25 -0700, "Richard Z"
wrote:

> I want to make a list of all my files in a folder. Ideally I'd like to have a program be able to
> read the files within a folder so I don't have to open up folder after folder but maybe I'm getting
> ahead of myself here. I can right click a file, Rename, Copy and Paste that into a document and it
> will show up perfectly. The problem is I can't seem to do that with more than 1 file at a time. I
> just want the name of the file on a list.



Here are four ways:

1. Go to a command prompt and issue the command

dir [drive:folder] > c:\tempfilename (you can use any name and put it
in any folder you want)

Then open notepad, open tempfilename, and print it from there.

2. Write (for example in Notepad) a 1-line text file:
DIR %1 /O >LPT1:

Save it as "printdir.bat" in the "Send To" folder.

Then, to print list of files in any folder, right-click that folder
and select Send to | printdir.bat

To include subfolders, change the comand to DIR %1 /O/S >LPT1:

3. Go to
http://support.microsoft.com/default.aspx?...bEN-USQ321379 and
follow the instructions there.

4. Download and use any of the several freeware/shareware utilities
that can do this, such as the popular
http://www.karenware.com/powertools/ptdirprn.asp


--
Ken Blake, Microsoft MVP - Windows Desktop Experience
Please Reply to the Newsgroup
 
I want to make a list of all my files in a folder. Ideally I'd like to have a program be able to
read the files within a folder so I don't have to open up folder after folder but maybe I'm getting
ahead of myself here. I can right click a file, Rename, Copy and Paste that into a document and it
will show up perfectly. The problem is I can't seem to do that with more than 1 file at a time. I
just want the name of the file on a list.
 
Richard Z wrote:
> I want to make a list of all my files in a folder. Ideally I'd like to
> have a program be able to read the files within a folder so I don't have
> to open up folder after folder but maybe I'm getting ahead of myself
> here. I can right click a file, Rename, Copy and Paste that into a
> document and it will show up perfectly. The problem is I can't seem to
> do that with more than 1 file at a time. I just want the name of the
> file on a list.



From the command prompt (Start > Run > Cmd.exe), simply change to
the desired directory and type "dir > filelist.txt" or "dir > lpt1,"
just as one 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

Directory Lister
http://www.krksoft.com/index.php


--

Bruce Chambers

Help us help you:
http://www.catb.org/~esr/faqs/smart-questions.html

http://support.microsoft.com/default.aspx/kb/555375

They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety. ~Benjamin Franklin

Many people would rather die than think in fact, most do. ~Bertrand Russell

The philosopher has never killed any priests, whereas the priest has
killed a great many philosophers.
~ Denis Diderot
 
Pegasus [MVP] wrote:
> "Richard Z" wrote in message
> news:uR3l$FZ$JHA.2824@TK2MSFTNGP03.phx.gbl...
>> I want to make a list of all my files in a folder. Ideally I'd like
>> to have a program be able to read the files within a folder so I
>> don't have to open up folder after folder but maybe I'm getting
>> ahead of myself here. I can right click a file, Rename, Copy and
>> Paste that into a document and it will show up perfectly. The
>> problem is I can't seem to do that with more than 1 file at a time. I
>> just want the name of the file on a list.

>
> After resolving this issue with the various tips from the other
> respondents, have a look at your PC clock. You're posting in the
> future. Either your clock is wrong or your PC is set to the wrong
> time zone.

No. He's totally from the future. I checked him out. He knows tomorrow's
lotto numbers.
 
"Lanwench [MVP - Exchange]"
wrote in message
>
> No. He's totally from the future. I checked him out. He knows tomorrow's
> lotto numbers.
>


Let's grab him while we can!
 
>>I want to make a list of all my files in a folder. Ideally I'd like to
>>have a program be able to read the files within a folder so I don't have to
>>open up folder after folder but maybe I'm getting ahead of myself here. I
>>can right click a file, Rename, Copy and Paste that into a document and it
>>will show up perfectly. The problem is I can't seem to do that with more
>>than 1 file at a time. I just want the name of the file on a list.

>
> After resolving this issue with the various tips from the other respondents,
> have a look at your PC clock. You're posting in the future. Either your
> clock is wrong or your PC is set to the wrong time zone.

Thanks for that tip. You were right on the money - wrong time zone.
smile.gif
 
Richard Z wrote:
>>> I want to make a list of all my files in a folder. Ideally I'd
>>> like to have a program be able to read the files within a folder so
>>> I don't have to open up folder after folder but maybe I'm getting
>>> ahead of myself here. I can right click a file, Rename, Copy and
>>> Paste that into a document and it will show up perfectly. The
>>> problem is I can't seem to do that with more than 1 file at a time.
>>> I just want the name of the file on a list.

>>
>> After resolving this issue with the various tips from the other
>> respondents, have a look at your PC clock. You're posting in the
>> future. Either your clock is wrong or your PC is set to the wrong
>> time zone.
>
> Thanks for that tip. You were right on the money - wrong time zone.
smile.gif


Heh. Keep patronizing us, Mr. Space Man. I'm on to you.
wink.gif
 
>> I want to make a list of all my files in a folder. Ideally I'd like to have a program be able to
>> read the files within a folder so I don't have to open up folder after folder but maybe I'm
>> getting
>> ahead of myself here. I can right click a file, Rename, Copy and Paste that into a document and
>> it
>> will show up perfectly. The problem is I can't seem to do that with more than 1 file at a time.
>> I
>> just want the name of the file on a list.

>
> Here are four ways:
> 1. Go to a command prompt and issue the command
> dir [drive:folder] > c:tempfilename (you can use any name and put it
> in any folder you want)

There seems to be a problem. I can navigate in there to any folder that has a 1 word title. But I
use numbers to keep the order correct. Like this:
1 Documents
2 Videos
3 Audio
When I use an underscore to "join" the words it doesn't work. When I use a space, just like its
displayed, it doesn't work either. Just says File Not Found.

> Then open notepad, open tempfilename, and print it from there.
>
> 2. Write (for example in Notepad) a 1-line text file:
> DIR %1 /O >LPT1:
>
> Save it as "printdir.bat" in the "Send To" folder.
>
> Then, to print list of files in any folder, right-click that folder
> and select Send to | printdir.bat
>
> To include subfolders, change the comand to DIR %1 /O/S >LPT1:
>
> 3. Go to
> http://support.microsoft.com/default.aspx?...bEN-USQ321379 and
> follow the instructions there.
>
> 4. Download and use any of the several freeware/shareware utilities
> that can do this, such as the popular
> http://www.karenware.com/powertools/ptdirprn.asp
>
>
> --
> Ken Blake, Microsoft MVP - Windows Desktop Experience
> Please Reply to the Newsgroup
 
Back
Top