WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Printing Information

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Create Printer Port from Remote Location


How to create (add) printer port from remote location VIA a COM object.

!!!!IMPORTANT!!!!

You will need to register the PRNADMIN.DLL which is found in the 2000 Server resourcekit supplement 1.

;Port types
kTcpRaw = 1
kTcpLPr = 2
kLocal = 3
kLocalDownLevel = 4
kLprMon = 5
kHPdlc = 7

oPort = CreateObject("Port.Port.1")
oMaster = CreateObject("PrintMaster.PrintMaster.1")
oPort.ServerName = "\\SERVERNAME"
oPort.PortName = "IP_10.10.20.27"
oPort.PortType = kTcpRaw
oPort.HostAddress = "10.10.20.27"
oPort.PortNumber = "9100"
oMaster.PortAdd (oPort)

MESSAGE ("All done","Complete !")


Article ID:   W16660
File Created: 2005:02:18:12:21:46
Last Updated: 2005:02:18:12:21:46