Add Printers to a PC

ROHAN 41 Reputation points
2022-02-02T09:35:23.767+00:00

0

Requirement is to Search and Add available printers on the remote PCs programmatically.

In case of a new PC I need to get a list of available/connected printers and allow the user to add them, basically doing the "Add printer" functionality from the Printers & Scanners window.

Is there a way to identify what printers I have available which then can be added to the PC.

I have come across AddPrinter command in PowerShell and WMI(C#) which basically adds a new PrintQueue to the PC. I am thinking this will need a physical printer connected to the PC as a prerequisite.

Any help on this would be appreciated.

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,197 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 81,461 Reputation points
    2022-02-03T16:07:30.917+00:00

    If you want to do the same thing as Windows does, you could launch the same command.
    Like (with default parameters) :

                    using (Process exeProcess = new Process())
                    {                   
                        exeProcess.StartInfo.FileName = "rundll32";
                        exeProcess.StartInfo.Arguments = @"printui.dll, PrintUIEntryDPIAware /il";
                        exeProcess.StartInfo.UseShellExecute = true;
                        exeProcess.Start();
                    }
    
    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Jack J Jun 24,276 Reputation points Microsoft Vendor
    2022-02-03T07:39:38.277+00:00

    @ROHAN , about how to get a list of available/connected printers, you could refer to the following link:

    List Network/locak Printers on Remote PC

    The following link describes that how do you connect to the remote printer.
    How to connect C# with Remote printer


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.