Can not show the Printer Queue from a local Printer

  • Thread starter Thread starter Karnowski Frank
  • Start date Start date
K

Karnowski Frank

Hallo

To show the printerqueue from a networkprinter the following statement
works:
Process.Start("\\\\Servername\\Printername" );

How can I show the queue from a local printer. The local printer has no
networkshare.
 
Hello,

You may try following code:

Process.Start("rundll32", "printui.dll,PrintUIEntry /o /nLocalPrinterName
")

For more commands of rundll32 printui.dll, you may refer to this KB article:

http://support.microsoft.com/default.aspx?scid=KB;EN-US;314486

Or type

type the following at a command prompt:

rundll32 printui.dll,PrintUIEntry /?

Hope this help

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Hello,

the code works fine with W2K and XP.
But 90% our clients are NT40SP6a. In Nt40 I get an errormessage:
"Error in printui.dll
Following entry is missing PrintUIEntry". I have translated the errormessage
from german in english.

Any Suggestions?

Thanks for your help
 
For Windows NT, There is no a direct way (with RunDLL32 or process.start),
we have to call some API function to retrieve the Printer jobs information.
You may take a look at following item to see if it will help:

HOW TO: Determine Printer Status and Print Job Status from Visual Basic
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q202480

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Back
Top