Dim $NovellPrinters[0]
Dim $NovellPorts[0]
Dim $NovellDrivers[0]
$x = 0
$y = 0
$w = 0
$ShellCMD = "printer.exe list " + chr(34) + "*" + chr(34) + " " + chr(34) + "\\novell\*" + chr(34)
$NovellPrinterRawList = WshPipe($ShellCMD)
for each $Printer in $NovellPrinterRawList
if instr($Printer,"PrinterName")
$PrinterName = split($Printer,": ")
$NovellPrinters[$x] = $PrinterName[1]
$x = $x + 1
ReDim Preserve $NovellPrinters[$x]
endif
if instr($Printer,"PortName")
$PortName = split($Printer,": ")
$NovellPorts[$y] = $PortName[1]
$y = $y + 1
ReDim Preserve $NovellPorts[$y]
endif
if instr($Printer,"DriverName")
$DriverName = split($Printer,": ")
$NovellDrivers[$w] = $DriverName[1]
$w = $w + 1
ReDim Preserve $NovellDrivers[$w]
endif
next
;--------------------------------------
; Remap other installed Novell printers
;--------------------------------------
for $z = 0 to ubound($NovellPrinters)
if $NovellPrinters[$z] <> ""
select
; Downstairs 8100
case instr($NovellPorts[$z],"PrnQ8100")
select
case instr($NovellDrivers[$z],"PCL")
if not PriMapState ("\\nt_print\HP8100-PCL6")
if PriMapState($NovellPrinters[$z])
$ShellCMD = "rundll32 printui.dll,PrintUIEntry /dl /n " + chr(34) + $NovellPrinters[$z] + chr(34)
Shell $ShellCMD
endif
$rc = AddPrinter("\\nt_print\HP8100-PCL6","_")
if $rc <> 1
? "Error " @ERROR + " " + @SERROR
endif
endif
; and so on for all the different printers / trays
endselect
endif