Spooler File on Windows

  • Thread starter Thread starter Larry Maturo
  • Start date Start date
L

Larry Maturo

I'm not sure if this is the right group to post this to, but here goes.
I need to find out the name of the print spool file for every job queued to
a particular printer. I actually need to read a few lines from the
spool file as well. The best I've been able to do so far is the name
of the original document, without a path to it. To get that far I had
to import some functions from winspool.

By the way, the spooled data is Postscript, so it actually is a program in
the Postscript language and readable. I need to read a few comments at the
top of the file, which in Postscript are any lines starting with "%".

-- Larry Maturo
 
Hi Frank,

Thank you for your help. I've checked it out, and I can't even find the
directory for the print spooler in the registry. I did a search, and it
turns out that by default nothing is listed in the registry. You can add
keys to the registry, however, to either change the spool directory, or
specify a different directory for particular printers (or every printer,
if you like). But what I actually need is the name of the particular
print spool file for the currently executing print job, or for the last
queued print job. These names are generated randomly by windows.
Of course they are not really random, but they are unpredictable if
you don't know Microsofts algorithm.

-- Larry Maturo
 
Yikes, this is looking worse and worse. I've never run across an API for
that - so again, the brute-force way - is you could write a service that
monitors the spool directory (filesystemwatcher).. and whenever a file is
added, you can handle it appropriately.. this would only really work if you
tracked every file that got spooled on that machine though... hope that
helps..
 
Hi Frank,

I would love to do that, but the problem is that there are multiple
printers, and
I need to know which spool file goes with which printer. If the client buys
off
on adding registry keys and adding a seperate spool file directory for each
printer, then that's the route I'll go. If he dosen't buy off on that, I'm
looking for
an alternative solution. The point to this job is to track which printer a
particular
file got printed on, and tie it to the information in the spool file that
was added
as comments by the clients Print Processor. The normal print processor is
WinPrint, but you can add your own. That's what fax programs do. Because
the Print Processor is installed into the Windows print system, its in just
the
right place to do its magic. Unfortunately, the client did not pay for
source to
this component, and the people they paid to write it want a fortune to add
this
capability.

Again, thank you for your help.

-- Larry
 
Back
Top