Making a list of the files in a folder, how?

  • Thread starter Thread starter Nehmo
  • Start date Start date
N

Nehmo

Windows XP Home SP2

When I want to send, or post, a list of the contents of a folder, I
use Windows Explorer > Open the folder > Change the Views to List >
use Kleptomania (a small app for copying text on the screen to the
clipboard) > then I paste it where I want.

But there's some way of listing all the files in a folder. I know
there's a way via the command prompt. I used it once, but I don't
remember how I did it. What is that way? And is there any other way of
doing this?
 
How to add a Print Directory to Windows XP:-
http://support.microsoft.com/default.aspx?scid=kb;EN-US;321379

http://www.karenware.com/powertools/ptdirprn.asp
Directory Printer

1) Click START, then click RUN
2) Type in CMD and select OK.
The Windows Command Prompt appears.
3) Access the directory where your files are.
For example: If the files are located in Documents and Settings\User Name\My Documents\My
Music, then you would type CD "C:\documents and settings\user name\my documents\my music"
and press the enter key. NB: include the quotation marks.
If you are unsure of the correct path right click one of the files in the directory that
you wish to make a list of and select properties from the menu popup and then look for the
field Location, this will give you the path.
4) Once you have accessed the directory (step 3) then type : DIR> myfiles.txt
then press enter. This will create a text file myfiles.txt.
5) In Explorer, browse to the folder, locate the myfiles.txt file.
Note this file can be edited in Notepad or any other Word processing program you have.



--

====================================
TaurArian [MS-MVP] 2005-2007 - Australia
====================================
How to make a good post: http://www.dts-l.org/goodpost.htm
Backup and data recovery: http://www.acronis.com.sg/
Enhancing file system performance: http://www.diskeeper.com/defrag.asp


| Windows XP Home SP2
|
| When I want to send, or post, a list of the contents of a folder, I
| use Windows Explorer > Open the folder > Change the Views to List >
| use Kleptomania (a small app for copying text on the screen to the
| clipboard) > then I paste it where I want.
|
| But there's some way of listing all the files in a folder. I know
| there's a way via the command prompt. I used it once, but I don't
| remember how I did it. What is that way? And is there any other way of
| doing this?
| --
| (||) Nehmo (||)
|
 
Nehmo said:
Windows XP Home SP2

When I want to send, or post, a list of the contents of a folder, I
use Windows Explorer > Open the folder > Change the Views to List >
use Kleptomania (a small app for copying text on the screen to the
clipboard) > then I paste it where I want.

But there's some way of listing all the files in a folder. I know
there's a way via the command prompt. I used it once, but I don't
remember how I did it. What is that way? And is there any other way of
doing this?



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:



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
 
This will redirect the folder contents to a file.
dir >Filename.txt
To see more or what the DIR command can do type dir/? at the dos prompt.
 
HOW TO Add a Print Directory Feature for Folders in Windows XPhttp://support.microsoft.com/?kbid=321379

I tried the steps on that page. I'll copy it below (after my
signature) to save everybody clicking time.

Unfortunately, I did everything and I reached the point that says
'After you follow the steps in the previous sections, ...Or, if you
have associated other actions with file folders, those actions may be
performed instead. '

I'm getting VLC media player starting when I double click on a folder.
When I rightclick and choose Explore, the printer tries (not
connected) to start. I really didn't want the printer to physically
print a list of the files. And of course I don't want it to happen
when I just try to open a folder.

So now I have to do the Registry edit. I'm a little worried. I only
have one computer.

I'm writing this while I'm working the problem. Well, I tried the
registry fix as described, and it worked. Whew...that was close.

Actually, right after the behavior of opening VLC started, I tried to
set a default for double clicking on a folder. There was no listing in
the Edit File Type box for Explorer to open, so I tied to set as
default the new thing I just added, the Print Directory Listing. As I
said, and as the article warned, another behavior (opening VLC, which
is set to play a playable file in a folder if there is one) happened.

But now, except for the new rightclick item, things are back to
normal.

Now I have a new option on the rightclick, Print Directory Listing

Form all this, I realize what I really wanted to know was to how to
use the DIR command. TaurArian explained that, but his answer included
the option of making a text file listing all the files in a folder.
That's fine, but it's not really necessary. Once you have the files
listed on the screen, you can make a file from the list, of course.
--
(||) Nehmo (||)
-------------------------------------

SUMMARY
This article describes how to add the Print Directory feature for
folders in Microsoft Windows XP. After you follow the steps that are
listed in this article, you can right-click a folder, and then click
Print Directory Listing to print a directory listing of the contents
of a folder.

Back to the top
Create the Printdir.bat file
To create the Printdir.bat file, follow these steps:
1. Click Start, click Run, type the following command, and then click
OK:
notepad
2. Paste the following text into Notepad:
@echo off
dir %1 /-p /o:gn > "%temp%\Listing"
start /w notepad /p "%temp%\Listing"
del "%temp%\Listing"
exit
3. On the File menu, click Exit, and then click Yes to save the
changes.
4. In the Save As dialog box, type the following text, and then click
Save:
%windir%\Printdir.bat

Back to the top
Create a new action for file folders
1. Click Start, click Control Panel (or, point to Settings, and then
click Control Panel), and then click Folder Options.
2. On the File Types tab, click File Folder.
3. Click Advanced, and then click New.
4. In the Action box, type:
Print Directory Listing
5. In the Application used to perform action box, type:
printdir.bat
6. Click OK.
7. Click OK, click OK, and then click Close.

Back to the top
Edit the registry
Warning Serious problems might occur if you modify the registry
incorrectly by using Registry Editor or by using another method. These
problems might require that you reinstall your operating system.
Microsoft cannot guarantee that these problems can be solved. Modify
the registry at your own risk.

After you follow the steps in the previous sections, Search Companion
may start when you double-click a folder instead of the folder being
opened. Or, if you have associated other actions with file folders,
those actions may be performed instead.

To resolve this issue, follow these steps:
1. Start Registry Editor.
2. Locate the Default value under the following key in the registry:
HKEY_CLASSES_ROOT\Directory\shell
3. Click Modify on the Edit menu.
4. In the Value data box, type:
none
5. Click OK.
6. Quit Registry Editor.
 
Nehmo said:
I tried the steps on that page. I'll copy it below (after my
signature) to save everybody clicking time.

Unfortunately, I did everything and I reached the point that says
'After you follow the steps in the previous sections, ...Or, if you
have associated other actions with file folders, those actions may be
performed instead. '

I'm getting VLC media player starting when I double click on a folder.
When I rightclick and choose Explore, the printer tries (not
connected) to start. I really didn't want the printer to physically
print a list of the files. And of course I don't want it to happen
when I just try to open a folder.

So now I have to do the Registry edit. I'm a little worried. I only
have one computer.

I'm writing this while I'm working the problem. Well, I tried the
registry fix as described, and it worked. Whew...that was close.

Actually, right after the behavior of opening VLC started, I tried to
set a default for double clicking on a folder. There was no listing in
the Edit File Type box for Explorer to open, so I tied to set as
default the new thing I just added, the Print Directory Listing. As I
said, and as the article warned, another behavior (opening VLC, which
is set to play a playable file in a folder if there is one) happened.

But now, except for the new rightclick item, things are back to
normal.

Now I have a new option on the rightclick, Print Directory Listing

Form all this, I realize what I really wanted to know was to how to
use the DIR command. TaurArian explained that, but his answer included
the option of making a text file listing all the files in a folder.
That's fine, but it's not really necessary. Once you have the files
listed on the screen, you can make a file from the list, of course.
--
(||) Nehmo (||)
-------------------------------------

SUMMARY
This article describes how to add the Print Directory feature for
folders in Microsoft Windows XP. After you follow the steps that are
listed in this article, you can right-click a folder, and then click
Print Directory Listing to print a directory listing of the contents
of a folder.

Back to the top
Create the Printdir.bat file
To create the Printdir.bat file, follow these steps:
1. Click Start, click Run, type the following command, and then click
OK:
notepad
2. Paste the following text into Notepad:
@echo off
dir %1 /-p /o:gn > "%temp%\Listing"
start /w notepad /p "%temp%\Listing"
del "%temp%\Listing"
exit
3. On the File menu, click Exit, and then click Yes to save the
changes.
4. In the Save As dialog box, type the following text, and then click
Save:
%windir%\Printdir.bat

Back to the top
Create a new action for file folders
1. Click Start, click Control Panel (or, point to Settings, and then
click Control Panel), and then click Folder Options.
2. On the File Types tab, click File Folder.
3. Click Advanced, and then click New.
4. In the Action box, type:
Print Directory Listing
5. In the Application used to perform action box, type:
printdir.bat
6. Click OK.
7. Click OK, click OK, and then click Close.

Back to the top
Edit the registry
Warning Serious problems might occur if you modify the registry
incorrectly by using Registry Editor or by using another method. These
problems might require that you reinstall your operating system.
Microsoft cannot guarantee that these problems can be solved. Modify
the registry at your own risk.

After you follow the steps in the previous sections, Search Companion
may start when you double-click a folder instead of the folder being
opened. Or, if you have associated other actions with file folders,
those actions may be performed instead.

To resolve this issue, follow these steps:
1. Start Registry Editor.
2. Locate the Default value under the following key in the registry:
HKEY_CLASSES_ROOT\Directory\shell
3. Click Modify on the Edit menu.
4. In the Value data box, type:
none
5. Click OK.
6. Quit Registry Editor.
As a suggestion, the next time you experiment with the shell, create a
system restore point before making any changes. Then you will not have to
edit the registry to undo your mistakes, just restore to the good system
restore point. If you forget to create a system restore point first , just
restore to the last good restore point that was automatically created.
However you may lose recent software updates and customizations this way.
System Restore can be a helpful feature to undo changes made
unintentionally.
 
Nehmo said:
Now I have a new option on the rightclick, Print Directory Listing

Form all this, I realize what I really wanted to know was to how to
use the DIR command. TaurArian explained that, but his answer included
the option of making a text file listing all the files in a folder.
That's fine, but it's not really necessary. Once you have the files
listed on the screen, you can make a file from the list, of course.
--
(||) Nehmo (||)
-------------------------------------

SUMMARY
This article describes how to add the Print Directory feature for
folders in Microsoft Windows XP. After you follow the steps that are
listed in this article, you can right-click a folder, and then click
Print Directory Listing to print a directory listing of the contents
of a folder.

Back to the top
Create the Printdir.bat file
To create the Printdir.bat file, follow these steps:
1. Click Start, click Run, type the following command, and then click
OK:
notepad
2. Paste the following text into Notepad:
@echo off
dir %1 /-p /o:gn > "%temp%\Listing"
start /w notepad /p "%temp%\Listing"

IIUC, you don't want the DIR listing sent to the printer, rather you want it
listed to a file. Remove the "/p" after notepad in the line above and it
will open the temp listing in Notepad instead of printing it. You can choose
to save the listing (or select portions) to a file of your choice, or just
close notepad and the temporary file will go away.
 
Windows XP Home SP2

When I want to send, or post, a list of the contents of a folder, I
use Windows Explorer > Open the folder > Change the Views to List >
use Kleptomania (a small app for copying text on the screen to the
clipboard) > then I paste it where I want.

But there's some way of listing all the files in a folder. I know
there's a way via the command prompt. I used it once, but I don't
remember how I did it. What is that way? And is there any other way of
doing this?

Have you tried:

DIR /B>File.Txt

the /B switch gives you a listing of files in a directory, without all
the extraneous header and footer info, file sizes, dates, etc. Just
filenames. With this example, the output is piped to a file called
FILE.TXT.

More Info:
http://www.fortypoundhead.com/showcontent.asp?ArtID=778

HTH,
Derek
 
Nehmo said:
Windows XP Home SP2

When I want to send, or post, a list of the contents of a folder, I
use Windows Explorer > Open the folder > Change the Views to List >
use Kleptomania (a small app for copying text on the screen to the
clipboard) > then I paste it where I want.

But there's some way of listing all the files in a folder. I know
there's a way via the command prompt. I used it once, but I don't
remember how I did it. What is that way? And is there any other way of
doing this?

See the DIRLIST TWEAK at: http://edmullen.net/utility.html
 
Back
Top