0

Is there any way to retrieve all the printers installed by various windows user accounts on same machine.

lookupPrintServices() method of the javax.print.PrintServiceLookup class displays all the printers which can be seen in the Control Panel in Windows for logged in user.

SadurdinaG
  • 33
  • 1
  • 8

1 Answers1

-1

It will help

import javax.print.PrintService;
import javax.print.PrintServiceLookup;


public class CheckInstalledPrinter {
    public static void main (String [] args)
    {
        PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, null);
        System.out.println("Total Services :: " + printServices.length);

        for (PrintService printer : printServices)
            System.out.println("Printer Name :: " + printer.getName()); 
    }
}
Ankush soni
  • 1,439
  • 1
  • 15
  • 30
  • As per my execution of above code it returns printer names from control panel not from other windows user account who has installed different printers. – SadurdinaG Oct 06 '16 at 20:32