Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
  • 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:

SET var=%%F
ECHO Print Job Does Not Exist
) ELSE (
ECHO Print Job Completed
share|improve this question
Doesn't it appear in the printer properties/what's printing window, like it does for a regular Windows based printer? – John Gardeniers Jun 8 '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. – Mechaflash Jun 9 '11 at 13:16

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.