Limiting job size?

  • Thread starter Thread starter Steve Bill
  • Start date Start date
S

Steve Bill

We have an application that produces files that can be
hundreds of pages if printed. It's a batch document
scanner. Instead of each page being its own file, a batch
of pages is one file. Occasionally, a user will accidently
print the whole thing instead of a page or two from it.
I'd like to automatically prevent this from happening by
limiting the number of pages that can be submitted in a
single print job. I can't find anything in windows that
can do this. Does anybody here now of anything?
 
Search for PRNJOBS.VBS on your computer -- (probably in SYSTEM32) -- it is a
VisualBasic script that can access the printer queue and display status.
You run it like this:

cscript %systemroot%\system32\prnjobs.vbs -p "printer name" -l

This will display the status of print-jobs for that printer, and one of the
lines is "Total pages". You would want a script that periodically wakes up
and does something like this:

C> cscript %systemroot%\system32\prnjobs.vbs -p "printer name" -l > X.TMP
C> find "Total pages" < X.TMP > X1.TMP
C> find "Job id" < X.TMP > X2.TMP
.... here is the tricky part, getting the last word from X1.TMP, the total
pages,
.... and comparing it to some number you set as the limit, and if it is too
large,
.... getting the last word from X2.TMP, the Job id, and issuing this command:
C> cscript %systemroot%\system32\prnjobs.vbs -p "printer name" -x -j "job
id #"

I don't have much experience using Windows scripting tools, so I don't know
how to go any further with this. Maybe you can modify the PRNJOBS.VBS
script itself?
 
I was hoping for something simpler like a group permission
on the printer that would allow users to print 500 one-
page documents with no problem but would stop them from
printing 1 500-page document! I don't know much about
scripts but I don't think a script can constantly monitor
a printer queue (or anything else for that matter).

Thanks for the effort though!
 
Hello,

This is a very interesting feature. It should be part of the printer
driver, right in there with MaxCopies -- "MaxPages" -- before requiring
confirmation to proceed -- disallow all print jobs over this size.

I did a little research in printer drivers (I work for KonicaMinolta -- just
started, not an expert in printer drivers) but did not find this kind of
feature.

I found this link:
http://www.microsoft.com/technet/scriptcenter/guide/sas_prn_fktg.mspx It
seems to be about what you are looking for: Monitoring Print Job Status,
getting Total Pages in a Job. I think you would be able to get what you
want with this information.

Bart.
 
Back
Top