Windows 2003 R2 SE, SP2.
I am using the code below in a VBScript to create printers on a remote printer server, CMC-PRN. The code works flawlessly and creates the port and the printer just fine, however, it always defaults to using the first 8 characters of the printer name for the share name - and seems to ignore (without error) the settings below.
Any ideas?
Thanks!!!
I am using the code below in a VBScript to create printers on a remote printer server, CMC-PRN. The code works flawlessly and creates the port and the printer just fine, however, it always defaults to using the first 8 characters of the printer name for the share name - and seems to ignore (without error) the settings below.
Any ideas?
Thanks!!!
Code:
set oPort = CreateObject("Port.Port.1")
set oMaster = CreateObject("PrintMaster.PrintMaster.1")
oPort.ServerName = "\\cmc-prn"
oPort.PortName = "UMCKY8008-PRT"
oPort.HostAddress = "epic-prd-eps"
oPort.PortType = 2
oPort.QueueName = "UMCKY8008"
oMaster.PortAdd oPort
set oPrinter = CreateObject("Printer.Printer.1")
oPrinter.ServerName = "\\cmc-prn"
oPrinter.PrinterName = "UMCKY8008"
oPrinter.DriverName = "HP LaserJet 4"
oPrinter.PortName = "UMCKY8008-PRT"
oPrinter.ShareName = "ABCDEFGHIJ"
oPrinter.EnableBidi = False
oMaster.PrinterAdd oPrinter
oMaster.PrinterGet "\\CMC-PRN", "UMCKY8008", oPrinter
oPrinter.Location = "ADTEST - This is a test printer."
oPrinter.Shared = True
oMaster.PrinterSet oPrinter