0
  • Client: Windows XP
  • Print Server: Ubuntu via CUPS

Is there a way to query the printer queue on the server from a client to retrieve the name of the file being printed?

Code example would be something like:

FOR /F "tokens=* USEBACKQ" %%F IN (`COMMAND TO QUERY PRINT JOBS ^| FIND "FILENAME"`) DO (
SET var=%%F
)
IF NOT DEFINED var (
ECHO Print Job Does Not Exist
) ELSE (
ECHO Print Job Completed
)
Anthony Miller
  • 457
  • 3
  • 6
  • 19
  • Doesn't it appear in the printer properties/what's printing window, like it does for a regular Windows based printer? – John Gardeniers Jun 08 '11 at 22:49
  • Keep in mind I want to pull this information from a batch script (command line) and not the GUI. I need to be able to pull the string containing the name of the file being printed to create an argument... updating the question with a sample of what the code COULD look like. – Anthony Miller Jun 09 '11 at 13:16

1 Answers1

0

I totally forgot to update this =D.

My solution ended up being querying the local print queue on the workstation.

CSCRIPT "C:\WINDOWS\system32\PRNJOBS.vbs" -l ^| FIND /I "printed file"

Running that queries the local print jobs with their file names, then I search for the file in the output to see if it successfully made it to the print queue. This is the closest that I could come to my solution and it has been working thusfar.

Anthony Miller
  • 457
  • 3
  • 6
  • 19