Spooler File on Windows

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Larry Maturo

    Spooler File on Windows

    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


  • Larry Maturo

    #2
    Re: Spooler File on Windows

    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



    "Frank Drebin" <noemail@imsick ofspam.com> wrote in message
    news:hKK0b.2787 6$Vx2.12801617@ newssvr28.news. prodigy.com...[color=blue]
    > You could probably get that from the registry - probably something like
    > HKLM/Software/Microsoft/WindowsNT/CurrentVersion/Print/Printers/...
    >
    > I don't have a printer physically hooked up to a PC around here, so I[/color]
    can't[color=blue]
    > check..
    >
    > "Larry Maturo" <lmaturo@austin .rr.com> wrote in message
    > news:eFK0b.865$ pW3.115912@twis ter.austin.rr.c om...[color=green]
    > > 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[/color]
    > to[color=green]
    > > 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[/color][/color]
    in[color=blue][color=green]
    > > the Postscript language and readable. I need to read a few comments at[/color]
    > the[color=green]
    > > top of the file, which in Postscript are any lines starting with "%".
    > >
    > > -- Larry Maturo
    > >
    > >[/color]
    >
    >[/color]


    Comment

    • Frank Drebin

      #3
      Re: Spooler File on Windows

      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 (filesystemwatc her).. 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..

      "Larry Maturo" <lmaturo@austin .rr.com> wrote in message
      news:VKL0b.1071 $vA5.102950@twi ster.austin.rr. com...[color=blue]
      > 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
      >
      >
      >
      > "Frank Drebin" <noemail@imsick ofspam.com> wrote in message
      > news:hKK0b.2787 6$Vx2.12801617@ newssvr28.news. prodigy.com...[color=green]
      > > You could probably get that from the registry - probably something like
      > > HKLM/Software/Microsoft/WindowsNT/CurrentVersion/Print/Printers/...
      > >
      > > I don't have a printer physically hooked up to a PC around here, so I[/color]
      > can't[color=green]
      > > check..
      > >
      > > "Larry Maturo" <lmaturo@austin .rr.com> wrote in message
      > > news:eFK0b.865$ pW3.115912@twis ter.austin.rr.c om...[color=darkred]
      > > > I'm not sure if this is the right group to post this to, but here[/color][/color][/color]
      goes.[color=blue][color=green][color=darkred]
      > > > I need to find out the name of the print spool file for every job[/color][/color][/color]
      queued[color=blue][color=green]
      > > to[color=darkred]
      > > > 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[/color][/color][/color]
      program[color=blue]
      > in[color=green][color=darkred]
      > > > the Postscript language and readable. I need to read a few comments[/color][/color][/color]
      at[color=blue][color=green]
      > > the[color=darkred]
      > > > top of the file, which in Postscript are any lines starting with "%".
      > > >
      > > > -- Larry Maturo
      > > >
      > > >[/color]
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Larry Maturo

        #4
        Re: Spooler File on Windows

        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


        "Frank Drebin" <noemail@imsick ofspam.com> wrote in message
        news:eML0b.2789 7$Vx2.12816578@ newssvr28.news. prodigy.com...[color=blue]
        > 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 (filesystemwatc her).. and whenever a file is
        > added, you can handle it appropriately.. this would only really work if[/color]
        you[color=blue]
        > tracked every file that got spooled on that machine though... hope that
        > helps..
        >
        > "Larry Maturo" <lmaturo@austin .rr.com> wrote in message
        > news:VKL0b.1071 $vA5.102950@twi ster.austin.rr. com...[color=green]
        > > 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[/color][/color]
        add[color=blue][color=green]
        > > 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
        > >
        > >
        > >
        > > "Frank Drebin" <noemail@imsick ofspam.com> wrote in message
        > > news:hKK0b.2787 6$Vx2.12801617@ newssvr28.news. prodigy.com...[color=darkred]
        > > > You could probably get that from the registry - probably something[/color][/color][/color]
        like[color=blue][color=green][color=darkred]
        > > > HKLM/Software/Microsoft/WindowsNT/CurrentVersion/Print/Printers/...
        > > >
        > > > I don't have a printer physically hooked up to a PC around here, so I[/color]
        > > can't[color=darkred]
        > > > check..
        > > >
        > > > "Larry Maturo" <lmaturo@austin .rr.com> wrote in message
        > > > news:eFK0b.865$ pW3.115912@twis ter.austin.rr.c om...
        > > > > I'm not sure if this is the right group to post this to, but here[/color][/color]
        > goes.[color=green][color=darkred]
        > > > > I need to find out the name of the print spool file for every job[/color][/color]
        > queued[color=green][color=darkred]
        > > > 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[/color][/color][/color]
        name[color=blue][color=green][color=darkred]
        > > > > of the original document, without a path to it. To get that far I[/color][/color][/color]
        had[color=blue][color=green][color=darkred]
        > > > > to import some functions from winspool.
        > > > >
        > > > > By the way, the spooled data is Postscript, so it actually is a[/color][/color]
        > program[color=green]
        > > in[color=darkred]
        > > > > the Postscript language and readable. I need to read a few comments[/color][/color]
        > at[color=green][color=darkred]
        > > > the
        > > > > top of the file, which in Postscript are any lines starting with[/color][/color][/color]
        "%".[color=blue][color=green][color=darkred]
        > > > >
        > > > > -- Larry Maturo
        > > > >
        > > > >
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        Working...