Re: prnAdmin.dll on windows 2003
From: Tarjei T. Jensen (tarjei_at_online.no)
Date: 02/02/05
- Next message: Tom: "Re: Copying Files / Created Date"
- Previous message: Tarjei T. Jensen: "Re: Copying Files / Created Date"
- In reply to: Tarjei T. Jensen: "prnAdmin.dll on windows 2003"
- Next in thread: Tarjei T. Jensen: "Re: prnAdmin.dll on windows 2003"
- Reply: Tarjei T. Jensen: "Re: prnAdmin.dll on windows 2003"
- Messages sorted by: [ date ] [ thread ]
Date: 2 Feb 2005 09:13:14 +0100
Tarjei T. Jensen wrote:
> Any suggestions of what I have done wrong?
>
1. You stayed at work too long, so you did not read the documentation
carefully enough. prnAdmin.dll cannot create LprMon ports (that is worrying
since several types of multifunction machines seems to need it in order to
perform decently).
You may want to manipulate the registry in order to create LprMon ports
automatically. And then stop and start the spooler to get it to notice the
ports.
LprMon ports live in
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Monitors\LPR
Port\Ports.
2. You read the port type as text, so there was a numeric comparison to text
and that did not work very well.
Revised working function.
function create_port(port_name, port_type)
dim aPort
aPort = split(port_name, ":")
port_type = port_type + 0 ' Force to numeric
create_port = true
oPort.ServerName = ""
oPort.PortName = port_name
if ( KLprMon = port_type ) or ( KTcpLpr = port_type ) then
wscript.echo "Here"
oPort.PortType = KTcpLpr
oPort.HostAddress = aPort(0)
oPort.QueueName = aPort(1)
oPort.DoubleSpool = true
else
oPort.PortType = port_type
end if
oPort.SNMP = false
oMaster.PortAdd oPort
if 0 <> Err or Err <> &H80070034 then
wscript.echo port_name & " " & port_type & " " & err
create_port = false
end if
end function
- Next message: Tom: "Re: Copying Files / Created Date"
- Previous message: Tarjei T. Jensen: "Re: Copying Files / Created Date"
- In reply to: Tarjei T. Jensen: "prnAdmin.dll on windows 2003"
- Next in thread: Tarjei T. Jensen: "Re: prnAdmin.dll on windows 2003"
- Reply: Tarjei T. Jensen: "Re: prnAdmin.dll on windows 2003"
- Messages sorted by: [ date ] [ thread ]