title: HTA determine if the Printer is Installed and Inform the User
body: <pre><code>    console.log(newPrinter);
      alert("Installing New Printer");
      var WshNetwork = new ActiveXObject("WScript.Network");
      var PrinterPath = "\\\\Server\\Printer";
      WshNetwork.AddWindowsPrinterConnection(PrinterPath);
      WshNetwork.SetDefaultPrinter(PrinterPath);      
      var isInstalled = false;
      while(isInstalled = false)
      {
          var oPrinters = WshNetwork.EnumPrinterConnections();
          for(i = 0; i &lt; oPrinters.length; i += 2) {
              alert("Port " + oPrinters.Item(i) + " = " + oPrinters.Item(i + 1));
              if(PrinterPath == oPrinters.Item(i))
              {
                  isInstalled = true;
                  alert("Finished Installing Printer");
              }
          }
      }
  </code></pre>
  
  <p>It installs the Printer but then takes several seconds to install the Printer and there is no notification or alert.</p>
  
  <p>My alert UI never appears. </p>