Print Directory list -Article 321379

M

Mary

Article 32179 "Add a Print Directory Feature for Folder in
WIndows XP?" works great. However, can anyone tell me how
to have that directory print to a file instead of or in
addition to sending it to the printer? Here's the code:

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

Thanks, Mary
 
R

Ramesh [MVP]

Remove the "/p" to open in Notepad. "/p" sends the data to printer.

--
Ramesh, MS-MVP XP Shell/UI
http://www.mvps.org/sramesh2k


Article 32179 "Add a Print Directory Feature for Folder in
WIndows XP?" works great. However, can anyone tell me how
to have that directory print to a file instead of or in
addition to sending it to the printer? Here's the code:

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

Thanks, Mary
 
A

Alex Nichol

Mary said:
@echo off
dir %1 /-p /o:gn > "%temp%\Listing"

That line has in fact put it in the Listing (I would use Filelist.txt as
clearer) in the TEMP folder (so you might have it more accessible by
simply using C:\Filelist.txt. The next two lines are there to load the
file into Notepad and delete the file and if the file is what you want,
leave them out.
start /w notepad /p "%temp%\Listing"
del "%temp%\Listing"
exit

If instead of
filespecification in the line you Use
PRN:

it will send it to the default printer; this tough will probably not
work if the printer is a USB one, only if it is on a Printer port
 

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

Top