How do I Add a Network Printer to Win95/NT
Keywords: CON2PRT.EXE Microsoft Zero Admin Toolkit
Question:
How do I add a network printer to Windows 95 and/or NT 4.0?
Answer:
See the Printer Control Extender function pAddPrinter.
pAddPrinter adds a printer to the list of supported printers for a server.
Syntax:
pAddPrinter(server-name, printer-name, port-name, driver-name, print-processor)
Parameters:
(s) server-name In Windows 95, this is not used, and should be set to "".
You can only add printers for the local machine. In
Windows NT, this specifies the machine on which to
create the printer. The caller must have admistrative
access to the server. You can specify "" for the local
machine.
(s) printer-name the name you want for the newly-added printer.
(s) port-name printer port. (ie., LPT1)
(s) driver-name must be the name of an already-installed driver. This
should be the driver's display name (eg, as shown in
the pull-down listbox for "Print using the following driver"
under a printer's properties), not the file name.
(s) print-processor will almost always be "WinPrint".
Returns:
(i) 1 on success, or a negative error code on failure.
Note that this function may take a minute or so to complete.
Example:
AddExtender("WWPRT34I.DLL")
pAddPrinter("", "My new printer", "LPT1:", "HP LaserJet 4", "WinPrint")
Article ID: W13682
Filename: Adding a Network Printer to NT-95.txt