1

Anyone know of a way to set a local printer port to use a system variable or some form of method to create a counter or unique identifier.

I currently have a printer setup where I have a new port as \\someserver\share\printjob.pcl

This then creates a PCL 5 file for the print job but I am wondering if there is a way to set a system variable to be acknowledged, like %username% so it generates something unique if multiple users are printing jobs.

Ultimately, I am converting the PCL file to a PDF via a custom VBScript service. unfortunately there is room for it stepping on itself which I want to try and avoid.

Malachi
  • 1,073
  • 1
  • 11
  • 26
ATek
  • 546
  • 5
  • 11

1 Answers1

1

You can use separation pages for this. Windows comes with a number of pre-defined separation pages but you need to enable separation pages from Printer Properties > Advanced tab > Separation Pages. Select the file you want (e.g. PCL.SEP) from C:\Windows\System32

You can modify the selected file. The Username (@N) is normally included in the default file, but you can add or put it somewhere else. You can also include the contents of a specified text file (@Fpathname). That file can contain the text you want. Alternatively, depending on which is easier for you, you can just add the text to the sep file (@T). If you really need a counter, then you may need to use some script to create the text file with the data.

The required syntax is available from Microsoft Support.

hdhondt
  • 4,149
  • 2
  • 14
  • 15
  • man, the timing on this couldn't be better... I just was on the server pondering some other re-design means because I had issues this afternoon with the script hanging up on itself. Going to give this a whirl. – ATek May 08 '14 at 07:35
  • unfortunately after reading more and understanding the usage on the KB page this wont particularly resolve the issue I am facing. Since the port path is hard coded each forthcoming job following can over write the previous if the service hasn't started picking up the file. – ATek May 08 '14 at 15:37
  • @ssaviers Not sure I understand your last comment. Are you saying that the printjob.pcl file will be overwritten by the next job? Of course it will - unless you do something with it (rename, move, etc) - but that does not affect the separation page, as that is part of the file. – hdhondt May 09 '14 at 11:55
  • yes, unfortunately when you print from this application I am dealing with it bursts up to 10 individual print jobs to the printer back to back, my script even running every half a second cant grab and lock the file fast enough. I can not set the vbscript to not have a sleep state or it throws wscript out of control. I am currently using a utility I found from PageTech that installs a PortMonitor driver which does facilitate an auto increment as it spools the files. So far its working, just not sure on the licensing yet, had hoped I could figure something out that didn't require 3rd tool. – ATek May 09 '14 at 17:19
  • Sounds as if that may be your only option, if the jobs come that fast. If you're using PageTech to create the PDF, their s/w can also insert the data you want. See http://www.thefreelibrary.com/PageTech+Announces+Release+of+Its+New+PCLMagic+Printer+Drivers.-a0273880779 – hdhondt May 11 '14 at 01:41