Question: Hello I have this code to retreive printer properties:

```
string printerName = "PrinterName";
string query = string.Format("SELECT * from Win32_Printer " 
                                + "WHERE Name LIKE '%{0}'",
                             printerName);

ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
ManagementObjectCollection coll = searcher.Get();

foreach (ManagementObject printer in coll)
{
    foreach (PropertyData property in printer.Properties)
    {
          Console.WriteLine(string.Format("{0}: {1}", 
                                          property.Name, 
                                          property.Value));
    }
}

```

But properties I need always return the same:

PrinterState:0

PrinterStatus:3

Basically I need this to check if printer is out of paper. What I think would be: PrinterState: 4

Tested on wxp-86 and w7-64 return the same, .Net 4.0

Thank you.

Answer: 
I had this problem as well and there is no easy fix to this. 

**The cause of the problem** is that Windows Management Instrumentation (WMI) retrieves the printer information from the ***spoolsv.exe*** process. So the reliability of the information retrieved depends completely on the printer driver. It is likely that the driver of the printer you are querying information for is either bypassing the spooler to get the status or it does not report the status to the spooler process.

**Win32\_Printer** will report whatever status is contained in the spooler. So if the spooler reports *Ready* then it never receives data with a status change as the default is *Ready*. **Win32\_Printer** just exports this as *Idle* (PrinterStatus = 3 or PrinterState = 0).
this line:

```
string query = string.Format("SELECT * from Win32_Printer " 
                            + "WHERE Name LIKE '%{0}'",
                         printerName);

```

try call it with % after printername:

```
string query = string.Format("SELECT * from Win32_Printer " 
                            + "WHERE Name LIKE '%{0}%'",
                         printerName);

```

often printer name is: "[printername] On [port]"