PC Review


Reply
Thread Tools Rate Thread

How to Automate Printing a Directory's Contents into a Text File??

 
 
Chuck
Guest
Posts: n/a
 
      8th Apr 2004
I have been trying to create a command that will allow me
to print a directory's contents as a text file. I had
something similar in Windows98 but can't find the
instructions. In searching, I found and made one that
allows me to right-click on a file in Explorer and print
its contents to the printer, but not to a text file. I
seem to recall that the one I used under 98 created a
file with a .prn extention in the directory in which I
right-clicked.

Instructions I found for doing it that don't work are:

C:\command.com /c dir > dir.txt

I guess it doesn't work because apparently XP has no
command.com.

A manual one that works at the dos prompt is:

C:\>dir c:\folderpath > c:\folderlist.txt

where folderpath is the name of the folder whose contents
I want to print and folderlist.txt is the name of the
created text file with the folder's contents listed in it.

I would rather have it automated so that all I have to do
is right click on the directory in explorer. Does anyone
know how to do this in XP?

Chuck
 
Reply With Quote
 
 
 
 
Slobodan Brcin \(eMVP\)
Guest
Posts: n/a
 
      8th Apr 2004
You were close.
Use: cmd /c dir >dir.txt

Regards,
Slobodan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Have an opinion on the effectiveness of Microsoft Embedded newsgroups? Tell
Microsoft!
https://www.windowsembeddedeval.com/...ity/newsgroups
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Chuck" <(E-Mail Removed)> wrote in message
news:1a2a201c41d96$734973b0$(E-Mail Removed)...
> I have been trying to create a command that will allow me
> to print a directory's contents as a text file. I had
> something similar in Windows98 but can't find the
> instructions. In searching, I found and made one that
> allows me to right-click on a file in Explorer and print
> its contents to the printer, but not to a text file. I
> seem to recall that the one I used under 98 created a
> file with a .prn extention in the directory in which I
> right-clicked.
>
> Instructions I found for doing it that don't work are:
>
> C:\command.com /c dir > dir.txt
>
> I guess it doesn't work because apparently XP has no
> command.com.
>
> A manual one that works at the dos prompt is:
>
> C:\>dir c:\folderpath > c:\folderlist.txt
>
> where folderpath is the name of the folder whose contents
> I want to print and folderlist.txt is the name of the
> created text file with the folder's contents listed in it.
>
> I would rather have it automated so that all I have to do
> is right click on the directory in explorer. Does anyone
> know how to do this in XP?
>
> Chuck



 
Reply With Quote
 
Chuck
Guest
Posts: n/a
 
      8th Apr 2004
Thanks, but it says it can't find the command, probably
because the batch file is on the desktop because I've
been working with it. Where does it go? c:\windows?

Also, I think my batch file is wrong becasue when I
double-click on it, it prints to the printer and not to a
file. The one I have is:

@dir %1 /-p /o:gn > "%temp%\dir.txt"
@notepad /p "%temp%\dir.txt"

What's wrong with it?

Chuck

>-----Original Message-----
>You were close.
>Use: cmd /c dir >dir.txt
>
>Regards,
>Slobodan
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>Have an opinion on the effectiveness of Microsoft

Embedded newsgroups? Tell
>Microsoft!
>https://www.windowsembeddedeval.com/...ity/newsgroups
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>"Chuck" <(E-Mail Removed)> wrote in

message
>news:1a2a201c41d96$734973b0$(E-Mail Removed)...
>> I have been trying to create a command that will allow

me
>> to print a directory's contents as a text file. I had
>> something similar in Windows98 but can't find the
>> instructions. In searching, I found and made one that
>> allows me to right-click on a file in Explorer and

print
>> its contents to the printer, but not to a text file. I
>> seem to recall that the one I used under 98 created a
>> file with a .prn extention in the directory in which I
>> right-clicked.
>>
>> Instructions I found for doing it that don't work are:
>>
>> C:\command.com /c dir > dir.txt
>>
>> I guess it doesn't work because apparently XP has no
>> command.com.
>>
>> A manual one that works at the dos prompt is:
>>
>> C:\>dir c:\folderpath > c:\folderlist.txt
>>
>> where folderpath is the name of the folder whose

contents
>> I want to print and folderlist.txt is the name of the
>> created text file with the folder's contents listed in

it.
>>
>> I would rather have it automated so that all I have to

do
>> is right click on the directory in explorer. Does

anyone
>> know how to do this in XP?
>>
>> Chuck

>
>
>.
>

 
Reply With Quote
 
KM
Guest
Posts: n/a
 
      9th Apr 2004
Chuck,

Your posts are confusing. First you said you tried a "command" (how?), now
you say you run a batch file.
By default your desktop directory will be under "\Documents and
Settings\<UserAccountName>\Desktop".

Remove "/p" switch after notepad.

KM

> Thanks, but it says it can't find the command, probably
> because the batch file is on the desktop because I've
> been working with it. Where does it go? c:\windows?
>
> Also, I think my batch file is wrong becasue when I
> double-click on it, it prints to the printer and not to a
> file. The one I have is:
>
> @dir %1 /-p /o:gn > "%temp%\dir.txt"
> @notepad /p "%temp%\dir.txt"
>
> What's wrong with it?
>
> Chuck
>
> >-----Original Message-----
> >You were close.
> >Use: cmd /c dir >dir.txt
> >
> >Regards,
> >Slobodan
> >
> >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >Have an opinion on the effectiveness of Microsoft

> Embedded newsgroups? Tell
> >Microsoft!
> >https://www.windowsembeddedeval.com/...ity/newsgroups
> >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >"Chuck" <(E-Mail Removed)> wrote in

> message
> >news:1a2a201c41d96$734973b0$(E-Mail Removed)...
> >> I have been trying to create a command that will allow

> me
> >> to print a directory's contents as a text file. I had
> >> something similar in Windows98 but can't find the
> >> instructions. In searching, I found and made one that
> >> allows me to right-click on a file in Explorer and

> print
> >> its contents to the printer, but not to a text file. I
> >> seem to recall that the one I used under 98 created a
> >> file with a .prn extention in the directory in which I
> >> right-clicked.
> >>
> >> Instructions I found for doing it that don't work are:
> >>
> >> C:\command.com /c dir > dir.txt
> >>
> >> I guess it doesn't work because apparently XP has no
> >> command.com.
> >>
> >> A manual one that works at the dos prompt is:
> >>
> >> C:\>dir c:\folderpath > c:\folderlist.txt
> >>
> >> where folderpath is the name of the folder whose

> contents
> >> I want to print and folderlist.txt is the name of the
> >> created text file with the folder's contents listed in

> it.
> >>
> >> I would rather have it automated so that all I have to

> do
> >> is right click on the directory in explorer. Does

> anyone
> >> know how to do this in XP?
> >>
> >> Chuck

> >
> >
> >.
> >



 
Reply With Quote
 
Chuck
Guest
Posts: n/a
 
      11th Apr 2004
Thanks everyone. Thanks to your help, I figured it out!

Chuck
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Store Directory contents INTO a text file??? Shenan Stanley Windows XP Help 0 29th Nov 2008 06:29 PM
Re: Store Directory contents INTO a text file??? JS Windows XP Help 0 29th Nov 2008 06:17 PM
Re: Store Directory contents INTO a text file??? Big_Al Windows XP Help 0 28th Nov 2008 11:49 PM
Re: Store Directory contents INTO a text file??? JS Windows XP Help 0 28th Nov 2008 11:46 PM
printing contents of a file directory in windows vista =?Utf-8?B?Sm9obg==?= Windows Vista Print / Fax / Scan 1 21st Aug 2007 07:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:21 AM.