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:\testspot\test.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?
mitaiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CompProbSolvCommented:
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.
0
hdhondtCommented:
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:\testspot\test.prn goto TryAgain
:: replace test.prn with the time
ren  c:\testspot\test.prn c:\testspot\%time%
:TryAgain
:: wait 10 seconds
sleep 10
Goto Begin
0
mitaiAuthor Commented:
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.
0
hdhondtCommented:
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?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mitaiAuthor Commented:
Thanks everyone for their input.  Looks like what I need cant be done šŸ˜ž
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Printers and Scanners

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.