04-04-2024 05:14 PM
Option Explicit Dim objNetwork, strPrinter1, strPrinter2, strPrinter3, strPrinter4 ' Define the names of the printers you want to add strPrinter1 = "\\print-rsc\HP-BW" strPrinter2 = "\\print-rsc\HP-Color" strPrinter3 = "\\print-rsc\ToshibaBW" strPrinter4 = "\\print-rsc\ToshibaColor" ' Create a WScript.Network object Set objNetwork = CreateObject("WScript.Network") ' Add each printer using the AddWindowsPrinterConnection method objNetwork.AddWindowsPrinterConnection strPrinter1 objNetwork.AddWindowsPrinterConnection strPrinter2 objNetwork.AddWindowsPrinterConnection strPrinter3 objNetwork.AddWindowsPrinterConnection strPrinter4 ' Display a message indicating that printers have been added MsgBox "Printers added successfully.", vbInformation, "Printers Added" ' Clean up Set objNetwork = Nothing
04-09-2024 06:49 AM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now