title: WMI Win32_Printer not showing up in =>Control Panel\All Control Panel Items\Devices and Printers
body: <p>There was a local printer in =>Control Panel\All Control Panel Items\Devices and Printers. and I deleted it manually by clicking "remove device". and the printer did get removed, not showing up anymore.</p>
  
  <p>the question is, we have .net code below to check if a printer installed or not. it returns true. it seems the printer still exist if we do 'SELECT * FROM Win32_Printer' by name.</p>
  
  <p>Questions:</p>
  
  <p>1) can someone give me more details, why the local printer record still exists?</p>
  
  <p>2) can I trust the code below, or maybe I need more conditions to check the printer installation?</p>
  
  <pre><code>ManagementScope oManagementScope = new ManagementScope(ManagementPath.DefaultPath);
  oManagementScope.Connect();
  SelectQuery oSelectQuery = new SelectQuery();
  oSelectQuery.QueryString = @"SELECT * FROM Win32_Printer WHERE Name = '" +  sPrinterName.Replace("\\", "\\\\") + "'";
  using(ManagementObjectSearcher oObjectSearcher = new ManagementObjectSearcher(oManagementScope, oSelectQuery))
  {
      using(ManagementObjectCollection oObjectCollection = oObjectSearcher.Get())
      {
          return oObjectCollection.Count &gt; 0;
      }
  }
  </code></pre>