Page 1 of 1 1
Topic Options
#211995 - 2016-10-05 09:31 PM The specified port is unknown? - AddPrinter() UDF
TJahones Offline
Fresh Scripter

Registered: 2016-10-05
Posts: 5
Loc: Canada
Hey all,

Long time listener, first time caller...

I am using the UDF AddPrinter() but when the script runs it seems to fail at the printer driver section? At least I think it does...

I receive a windows error "The Specified Port is Unknown"

Has anyone run into this before with the AddPrinter UDF? I tried searching the forums but didn't find anyone else with the same issue.

We're trying to eliminate print servers in our environment and add the printers by IP instead.

Any ideas?

Thanks in advance!

Top
#211997 - 2016-10-05 10:34 PM Re: The specified port is unknown? - AddPrinter() UDF [Re: TJahones]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
I doubt this has anything to do with the UDF and more to do with Windows. Will need more information about your environment, kix, printer, etc.
Top
#211999 - 2016-10-05 10:53 PM Re: The specified port is unknown? - AddPrinter() UDF [Re: Allen]
TJahones Offline
Fresh Scripter

Registered: 2016-10-05
Posts: 5
Loc: Canada
Hey Allen,

Thanks again for your time.

Windows 7 Pro 64 - Bit. Windows Server 2012 R2.

KIX: 4.53

Ricoh MPC 5503 printer.

Here is the snippet of code (I was trying locally as I thought maybe it was an access permissions issue before):

 Code:
  ADDPRINTER("10.8.8.22","PCL6 Driver for Universal Print","C:\Users\tjones\Downloads\z76358L17\64bit\oemsetup.inf","Ricoh 5503 LAB")
  ? "Trying to add by IP... "@error


Here is the OEMsetup.inf file I was trying to reference (I assumed printername would be DRVName but maybe this is where my issue lies?):
 Quote:

;------------------------------------------------------------
; Copyright (c) 2007-2016 RICOH COMPANY, LTD
; All Rights Reserved
; Printer Driver Setup Information File
;------------------------------------------------------------

[Version]
Signature = "$Windows NT$"
Provider = %Ricoh%
ClassGUID = {4D36E979-E325-11CE-BFC1-08002BE10318}
Class = Printer
DriverVer = 05/16/2016,4.10.0.0
DriverIsolation = 2

CatalogFile = ricu0a.cat

[Manufacturer]
%Ricoh%=Ricoh,NTamd64,NT.5.1


;WindowsXP(amd64)
[Ricoh.NTamd64]
%DrvName% = PrinterModel64.dat,USBPRINT\RICOHMP_2001360F,LPTENUM\RICOHMP_2001360F,RICOHMP_2001360F
%CoDrvName% = PrinterModel64_ver.dat,USBPRINT\RICOHPCL6DriveforUP,LPTENUM\RICOHPCL6DriveforUP,RICOHPCL6DriveforUP

;WindowsXP(x86)
[Ricoh.NT.5.1]
%DrvName% = PrinterModel64.dat,USBPRINT\RICOHMP_2001360F,LPTENUM\RICOHMP_2001360F,RICOHMP_2001360F
%CoDrvName% = PrinterModel64_ver.dat,USBPRINT\RICOHPCL6DriveforUP,LPTENUM\RICOHPCL6DriveforUP,RICOHPCL6DriveforUP

[PrinterModel64.dat]
CopyFiles = RPD_FILES,RPD_COMMON,RPD_COMMON_SYS32,@copcl6ud.txt
DataSection = RPD_DATA
DataFile = ricu0acd.psz
LanguageMonitor = ricu0alm,ricu0alm.dll

[PrinterModel64_ver.dat]
CopyFiles = RPD_FILES,RPD_COMMON,RPD_COMMON_SYS32
DataSection = RPD_DATA
DataFile = ricu0acd.psz
LanguageMonitor = ricu0alm,ricu0alm.dll

[RPD_FILES]
ricu0aui.dll,ricu0aui.dl_
ricu0aui.irj
ricu0aui.rdj
ricu0aui.rcf
ricu0aug.dll,ricu0aug.dl_
ricu0aug.miz
ricu0aur.dll,ricu0aur.dl_
ricu0agr.dll,ricu0agr.dl_
ricu0agl.dll,ricu0agl.dl_
ricu0aci.dll,ricu0aci.dl_
ricu0acd.dll,ricu0acd.dl_
ricu0acd.psz
ricu0acf.cfz
ricu0acl.ini
ricu0ach.chm
ricu0acz.dlz
ricu0acj.dll,ricu0acj.dl_
ricu0act.dll,ricu0act.dl_
ricu0acb.dll,ricu0acb.dl_
ricu0atl.exe,ricu0atl.ex_


[RPD_COMMON_SYS32]
ricu0alm.dll,ricu0alm.dl_,,0x00000020

[RPD_COMMON]
ricdb64.dll,ricdb64.dl_,,0x00000020
mfricr64.dll,mfricr64.dl_,,0x00000020
RD01Kd64.dll,RD01Kd64.dl_,,0x00000020

[RPD_DATA]
ConfigFile = ricu0aui.dll
DriverFile = ricu0agr.dll
HelpFile = ricu0ach.chm

[DestinationDirs]
DefaultDestDir = 66000
RPD_COMMON_SYS32 = 66002

[SourceDisksNames.amd64]
1 = %DSK%,,,

[PrinterPackageInstallation.amd64]
PackageAware =TRUE

[SourceDisksFiles.amd64]
ricu0aui.dl_ = 1
ricu0aui.irj = 1
ricu0aui.rdj = 1
ricu0aui.rcf = 1
ricu0aug.dl_ = 1
ricu0aug.miz = 1
ricu0aur.dl_ = 1
ricu0agr.dl_ = 1
ricu0agl.dl_ = 1
ricu0aci.dl_ = 1
ricu0acd.dl_ = 1
ricu0acd.psz = 1
ricu0acf.cfz = 1
ricu0acl.ini = 1
ricu0ach.chm = 1
ricu0acz.dlz = 1
ricu0acj.dl_ = 1
ricu0act.dl_ = 1
ricu0acb.dl_ = 1
ricu0alm.dl_ = 1
ricdb64.dl_ = 1
mfricr64.dl_ = 1
RD01Kd64.dl_ = 1
copcl6ud.txt = 1
ricu0atl.ex_ = 1

[Strings]
Ricoh = "Ricoh"
DrvName = "PCL6 Driver for Universal Print"
CoDrvName = "RICOH PCL6 UniversalDriver V4.10"
DSK = "PCL6 Printer Driver Disk1"





Edited by Mart (2016-10-06 09:00 AM)

Top
#212000 - 2016-10-05 11:17 PM Re: The specified port is unknown? - AddPrinter() UDF [Re: TJahones]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Hmmm, let me just preface my comments by... it been more than 10 years since I last used this thing. Glenn may have used it a little more recently.

When I made this there were no "Universal" printer drivers, so this could have something to do with it.

The function simply looks through the INF and tries to find the model you specify in $Printertype, so while it may actually find what you provided, there is no guarantee there is actually a section in the inf that works for the printer you are setting up. In hind sight this is a major flaw of this UDF.

What is the @error after the function, and is the Port Unknown a gui displayed error or is that happening in the script too?

Top
#212001 - 2016-10-05 11:19 PM Re: The specified port is unknown? - AddPrinter() UDF [Re: Allen]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
actually, what is the return code?
Top
#212002 - 2016-10-05 11:35 PM Re: The specified port is unknown? - AddPrinter() UDF [Re: Allen]
TJahones Offline
Fresh Scripter

Registered: 2016-10-05
Posts: 5
Loc: Canada
Hey Allen,

No worries at all, I really appreciate you taking a boo.

The port unknown is a GUI displayed error. I ran a hotfix that MS suggested (I figured maybe we had locked down our machines to the point they were missing a piece) but the error persists.

Perhaps I should try using a printer specific driver instead of the UPD?

The error code returns a 0

Top
#212003 - 2016-10-06 01:03 AM Re: The specified port is unknown? - AddPrinter() UDF [Re: TJahones]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Is the user an admin?
Top
#212004 - 2016-10-06 04:36 PM Re: The specified port is unknown? - AddPrinter() UDF [Re: Allen]
TJahones Offline
Fresh Scripter

Registered: 2016-10-05
Posts: 5
Loc: Canada
The user is an admin.

Update - If I have the printer added by IP already (I did it with VBS just to test a different method) then my kiXtart logon script will run no problem and add the printer without issue.

So it makes me think creating the port is failing?

Top
#212005 - 2016-10-06 04:54 PM Re: The specified port is unknown? - AddPrinter() UDF [Re: TJahones]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Sounds like a perms issue. I wonder if you run your cmd.exe as admin if the script will run. If this works, there is a elevate.exe I know of that can assist with this.
Top
#212007 - 2016-10-06 08:01 PM Re: The specified port is unknown? - AddPrinter() UDF [Re: Allen]
TJahones Offline
Fresh Scripter

Registered: 2016-10-05
Posts: 5
Loc: Canada
So strange! If I run CMD as admin then run the script it works. If I right click, run logon.bat as admin - fails!

I was able to run it as admin for the dozen machines out there (rather than fight with using elevate)

Thanks again Allen - you rock!

Top
#212008 - 2016-10-06 08:19 PM Re: The specified port is unknown? - AddPrinter() UDF [Re: TJahones]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Sweet. I forgot that UDF could install the drivers on remote pcs too. LOL.
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.1 seconds in which 0.075 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org