Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi...!!
For one particular application of mine, I need to print to a file. I am trying to automate the process of naming that file. Is there any way by which we can achieve this .....maybe by writing some scripts or routines. First and foremost is it possible to auotmate that process. Any Suggestions???
Thanks,

Hi Neelima,
If u are using NT,u can add a port to the system ,of type FILE (Instead of LPT1,LPT2 etc) and name it.Then add a printer to that port.whenever u print using this newly configured printer the o/p will be redirected to the file u have named when u configured the port.This is done automatically.The only problem is next time when u print , the previous contents will be overwritten.You may need to rename the file to something else using ur application before printing the next time.
if you are using windows 95,I think u are stuck up.Microsoft does not document anything like this in WIN-95,but I am sure there will be some undocumented way,since Windows NT is a souped up version of Windows-95.
Regards.

Hi Neelima
I had exactly the same requirement as you heres how to do it.........if using win95/98
Select properties of print to file printer.
goto details tab.
click add port
select other
type path for file in box that appears.
eg C:\Temp\Output.prn
Next time you print to file....woopeeeeeeee!
As Suresh rightly points out however, everytime you print it will overwrite the previous file - I found you're message whilst looking for a cure to this problem
(need someway of appending to this file - anyone else got any ideas) - will let you know if i find the answer!
Tom

To append, you could try somthing like this after creating the output file:
Copy /B C:\Temp\Appended.prn + C:\Temp\Output.prn C:\Temp\Appended.prn
This will "stack up" the contents of your Output.prn files in C:\Temp\Appended.prn. Be sure to include the "/B" parameter. You can batchfile the process or use Scripting to run the output file into the storage file after each new output file is created. IHTH!BT

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |