PDA

View Full Version : How can I print a list of all folders, filenames, and programs?


yooniecorn
05-15-2009, 01:18 PM
I'm interested in printing out a hard copy of a list of all folders PLUS all filenames within them, as well as a list of all programs on my computer.

Is there a way to do this within Windows XP Pro., or will I need to download a secondary utility?

nuz
05-15-2009, 06:28 PM
Use cmd to open up a DOS window, go to the drive root (<cd\>), type in <dir/s *.*> to get the list. Use </p> at the end to get a details view or </w> to just get the names. As for printing, the obvious way would be to try <print dir/s *.* /p> (or </w>), but I hope you have a LOT of paper ready if you want to try that.

classicsoftware
05-15-2009, 06:46 PM
Use cmd to open up a DOS window, go to the drive root (<cd\>), type in <dir/s *.*> to get the list. Use </p> at the end to get a details view or </w> to just get the names. As for printing, the obvious way would be to try <print dir/s *.* /p> (or </w>), but I hope you have a LOT of paper ready if you want to try that.

When you get to the command prompt type:

dir *.* /s >c:\filelist.txt

This will create a text file in the root directory that can be viewed with any word processor and formatted and printed in nay way you like.

Paul Komski
05-16-2009, 02:43 AM
as well as a list of all programs on my computer
A list of keys showing all formally installed Windows programs can be seen at HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uni nstall

You can take screenshots as one way of recording them or grab Belarc Advisor (http://www.belarc.com/free_download.html).

The A43 File Manager (http://alterion.us/a43/)'s File Menu has a nice simple way of creating a file with a list of the contents of the currently selected folder but it is not in any way recursive so probably no good for your needs. If you want to embellish what the two other responders have written first consider all the dir options and decide how you want your file display to be customized for your purposes.

Dir /? gives the following in WXP:-
Displays a list of files and subdirectories in a directory.

DIR [filename] [/A[[:]attributes]] [/B] [/C] [/L] [/N]
[/O[[:]sortorder]] [/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.
So I recommend you enter the following into notepad, save as filelist.bat and run that batch file when ready (but edited as takes your fancy). The output of the following line omits headings/summaries, is fully recursive, groups folders first and sorts by name. Be prepared to wait as the filelist.txt file is created. Mine was nearly 8MB in size - (105,657 lines of text!).
dir C:\ /o:gn /b /s > C:\filelist.txt

edit: maybe one should use either o:g or o:n and not both together.

nuz
05-16-2009, 02:03 PM
Forgot to add this on my last post, you'll have to repeat this for each partition. If you're in C: to start with, type <D:> for drive D:, then E:, F: as appropriate. If you're printing to file as classics suggestedd (much better idea than mine, btw) you probably want to create separate text files for each drive, just to be sure they don't overwrite. It's been a very long time since I've used DOS commands, so I'm not sure whether the default edit option is over write or append.

Paul Komski
05-16-2009, 03:06 PM
If you're in C: to start with, type <D:> for drive D:, then E:, F: as appropriate.
When issuing commands in DOS the current position is always the default but no matter where the prompt happens to be one can actually always specify the path rather than change directories to get there and create a new default position.

I'm not sure whether the default edit option is over write or append A single > always writes a new file. A double >> appends to an existing file.

It's been a very long time since I've used DOS commandsIf you are unsure or can't remember then maybe be cautious about posting advice.

yooniecorn
05-19-2009, 08:33 AM
A list of keys showing all formally installed Windows programs can be seen at HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uni nstall

You can take screenshots as one way of recording them or grab Belarc Advisor (http://www.belarc.com/free_download.html).

The A43 File Manager (http://alterion.us/a43/)'s File Menu has a nice simple way of creating a file with a list of the contents of the currently selected folder but it is not in any way recursive so probably no good for your needs. If you want to embellish what the two other responders have written first consider all the dir options and decide how you want your file display to be customized for your purposes.

Dir /? gives the following in WXP:-

So I recommend you enter the following into notepad, save as filelist.bat and run that batch file when ready (but edited as takes your fancy). The output of the following line omits headings/summaries, is fully recursive, groups folders first and sorts by name. Be prepared to wait as the filelist.txt file is created. Mine was nearly 8MB in size - (105,657 lines of text!).
dir C:\ /o:gn /b /s > C:\filelist.txt

edit: maybe one should use either o:g or o:n and not both together.

Thanks, everyone, for the suggestions. The batch file is perfect.

Two further questions:

1) Will the .txt files overwrite themselves, or will they be saved as 1,2,3, etc.?
2) Can I use XP's scheduling service to run this .bat file once every night?

Paul Komski
05-19-2009, 09:17 AM
Try

dir C:\ /o:gn /b /s > C:\filelist.txt
ren C:\filelist.txt %date:~-4,4%%date:~-7,2%%date:~-10,2%.log
for a datestamped .log file

or maybe

dir C:\ /o:gn /b /s > C:\filelist.txt
copy C:\filelist.txt C:\filelist.log
ren C:\filelist.log %date:~-4,4%%date:~-7,2%%date:~-10,2%.log

You can certainly use task scheduler to run a batch file. I use it as an alarm call that references a loud sound file.

:TOP

start mplay32.exe /play /close D:\My Documents\My Music\MMEDIA\SIREN1.WAV
sleep 10

GOTO TOP

Forgot to say that yes if you use a > it creates new and overwrites old