The following code can be used in a vbscript. That is
basically all that is needed to click and map printer.
Of course there are many more conditions that can be
set...
set WshNetwork = CreateObject("WScript.Network")
PrinterPath= "\\server\printer"
WshNetwork.AddWindowsPrinterConnection PrinterPath