Print Directory list -Article 321379

  • Thread starter Thread starter Mary
  • Start date Start date
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
 
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
 
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
 
Back
Top