Print Directory in XP

D

Don Schmidt

At this Microsoft site http://support.microsoft.com/kb/321379 it tells how
to add a Print Directory function to your Windows XP system.

My questions is, instead of "printing" the directory, I'd like it to make a
text file of the directory and it's subdirectories.

I have the dos way of doing it but if you did a print directory of the "C"
drive it would bankrupt you in the paper output. <G>
It's the reason for the text file. One could always print the text file.

Many thanks,
 
A

Another Brian

dir /s > somefile.txt

The ">" redirects the output to the file "somefile.txt". You can
include a path to another folder before the "somefile.txt."

You can find a lot of other ways to do this by using google. Try
searching for: windows print directories file

Brian
 
J

JD

Don said:
At this Microsoft site http://support.microsoft.com/kb/321379 it tells how
to add a Print Directory function to your Windows XP system.

My questions is, instead of "printing" the directory, I'd like it to make a
text file of the directory and it's subdirectories.

I have the dos way of doing it but if you did a print directory of the "C"
drive it would bankrupt you in the paper output. <G>
It's the reason for the text file. One could always print the text file.

Many thanks,
Change it a little bit and save as Savedir.bat

@echo off
dir %1 /-p /o:gn > "%temp%\Listing"
start /w notepad "%temp%\Listing"
del "%temp%\Listing"
exit
 
D

Don Schmidt

Many thanks JD.

I modified your coding a bit so as to also open subdirectories and list
hidden folders.

@echo off
dir %1 /a /s /-p /o:gn > "%temp%\Listing"
start /w notepad "%temp%\Listing"
del "%temp%\Listing"
exit

By making this modification it may cause the Search window to come up
instead of a folder to open but can be readily fixed with Microsoft's fix
found at:

http://support.microsoft.com/kb/321186

A slight oddity occurs after creating the Listing modification, the cmd.exe
window opens in the background but seems no harm done.

Again, thanks I appreciate your help very much.
 
B

Bruce Chambers

Don said:
At this Microsoft site http://support.microsoft.com/kb/321379 it tells how
to add a Print Directory function to your Windows XP system.

My questions is, instead of "printing" the directory, I'd like it to make a
text file of the directory and it's subdirectories.

I have the dos way of doing it but if you did a print directory of the "C"
drive it would bankrupt you in the paper output. <G>
It's the reason for the text file. One could always print the text file.

Many 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.


--

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
 

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

Similar Threads


Top