print to file on windows

Hi Everyone,

I have set up a printer under windows called myprinter and added a local port, that port i set to the name of a path on my computer c:testspottest.prn.

When i print to this printer it puts the test.prn file in the path and everything is great. One issue, i want to be able to keep the print files and right now when i print it overwrites the one that is already there. Is there anyway to have it use a number system or timestamp the filename so it would just keep adding filenames.

I also don't want to have to prompt for the name each time.

Any thoughts?



I don't think that there is a method to do this built in to Windows.

You could write a simple .cmd file to rename the .prn file and have it run as a scheduled task however often you think it necessary.



I don't think that there is a method to do this built in to Windows.

You could write a simple .cmd file to rename the .prn file and have it run as a scheduled task however often you think it necessary.



I can see two ways to do it.

The first is to use FILE: as the port. That way, you will be asked for the name of the file to create every time you print.

The second way is similar to what CompProbSolv suggested, but I would use a script as it is much easier to implement. Here's one suggestion. This file will loop forever, rename test.prn to the current time, wait 10 seconds and try again.
:Begin
If not exist c:testspottest.prn goto TryAgain:: replace test.prn with the time
ren c:testspottest.prn c:testspot%time%:TryAgain:: wait 10 seconds
sleep 10
Goto Begin



Thank you for the suggestions, I don't think either of these will work for my circumstance. I was hoping there was a way to have it as a variable right drone the original print. The issue is that on certain occasions I can have 5 or 6 prints at the same time and would have to have the script running every 10th of a second in order to not miss a print file.



There is no way to create a port with a variable file name.

Using something like AutoHotkey, you could create a script that does the printing for you, using FILE: as the port. Instead of just clicking Print, you would use a hotkey to start the print, the script then does the printing and enters the time as the filename.

Of course, that will only work if you start the prints manually. If they are created by some automated process, you would need to create the script at that point. Having "5 or 6 prints at the same time" implies that this is automated. If I am right in that, what is the application that does the printing?



Thanks everyone for their input. Looks like what I need cant be done ??

Share this

Related Posts

There was an error in this gadget