Net_AddPrinter
Description
Section titled “Description”Adds a connection to a shared network printer. Only printers on Windows networks are supported. If the printer is already connected, the connection is removed and added again.
Printer connections belong to the user. Use the function in a user (US) job, so the printer is added for the logged-on user.
Syntax
Section titled “Syntax”Net_AddPrinter(sPrinterShare, s9xPrinterDriver, bSetAsDefault) As Boolean
Parameters
Section titled “Parameters”sPrinterShare (String)
Section titled “sPrinterShare (String)”UNC path to the network printer
s9xPrinterDriver (String)
Section titled “s9xPrinterDriver (String)”Not used on current Windows versions. Use an empty string. (Printer driver name for Windows 9x and ME only.)
bSetAsDefault (Boolean)
Section titled “bSetAsDefault (Boolean)”Set this printer as default printer
Example
Section titled “Example”If bStatus Then bStatus = Net_AddPrinter("\\CAPAINSTALLER\PRINTERSHARE", "", True)Related functions
Section titled “Related functions”Net_SetDefaultPrinter Net_DeletePrinter Net_EnumPrinters Net_EnumPrinterPaths Constants Package Property Variables