Here is the script we are using for printer mapping. In our installation, the last 4 characters are the cube number.

;************************************************************
;** Script: Map Printer Script
;** Created: 08/06/2001
;** Updated: 10/13/2001
;**
;** Author: David C. Miller
;** E-mail: david.c.miller@nextel.com
;**
;** Purpose / Comments:
;** Map printers based on account membership and cube location
;**
;** Variables:
;**
;** Macros called by this macro:
;** $StatusKix
;**
;** Updates
;** 08/31/2001 Created and added all North end Printers
;** 10/13/2001 Used registry to save printers and load from registry
;** 10/24/2001 Stopped using registry since it does not enhance
;** performance and ignores group changes
;**
;************************************************************

$Wk = @WKSTA
IF UCASE(VAL(SUBSTR($WK, Len($Wk), 1))) == UCASE(SUBSTR($WK, Len($Wk), 1))
$Cube = VAL(SUBSTR($Wk, Len($Wk) - 3, 4))
ELSE
$Cube = VAL(SUBSTR($Wk, Len($Wk) - 4, 4))
ENDIF
$Stat = "Setting printers for cube: " + $Cube CALL $StatusKix
$SysPrintKey = "HKEY_LOCAL_MACHINE\Software\BCC\Printers"
$X = DELTREE($SysPrintKey)
$UserPrintKey = "HKEY_CURRENT_USER\Printers\Connections"
$NumUserPrint = 0

;** Delete existing printer connections
DIM $Printer[30]
$Count = 0
GOSUB "DeletePrinters"
DIM $Printer[30]
$Count = 0
GOSUB "ConnectPrinters"
RETURN

:ConnectPrinters
SELECT
Case $Cube >= 1001 AND $Cube <= 1011
$Printer[$Count] = "\\BCCW2FS01\BCCHPTN1110"
$X = ADDPRINTERCONNECTION($Printer[$Count])
$Stat = "Added connection to printer: " + $Printer[$Count] CALL $Statuskix
$Count = $Count + 1
$Printer[$Count] = "\\BCCW2FS01\BCCLPTNSOUTH"
$X = ADDPRINTERCONNECTION($Printer[$Count])
$Stat = "Added connection to printer: " + $Printer[$Count] CALL $Statuskix
$Count = $Count + 1

Case $Cube >= 1012 AND $Cube <= 1022
$Printer[$Count] = "\\BCCW2FS01\BCCHPTN1100"
$X = ADDPRINTERCONNECTION($Printer[$Count])
$Stat = "Added connection to printer: " + $Printer[$Count] CALL $Statuskix
$Count = $Count + 1
$Printer[$Count] = "\\BCCW2FS01\BCCLPTNSOUTH"
$X = ADDPRINTERCONNECTION($Printer[$Count])
$Stat = "Added connection to printer: " + $Printer[$Count] CALL $Statuskix
$Count = $Count + 1
ENDSELECT
; If no printer selected above, go to default printer
If $Count = 0
$Printer[$Count] = "\\BCCW2FS01\BCCHPTN1427"
$X = ADDPRINTERCONNECTION($Printer[$Count])
$Stat = "Added connection to printer: " + $Printer[$Count] CALL $Statuskix
$Count = $Count + 1
$Printer[$Count] = "\\BCCW2FS01\BCCLPTNNorth"
$X = ADDPRINTERCONNECTION($Printer[$Count])
$Stat = "Added connection to printer: " + $Printer[$Count] CALL $Statuskix
$Count = $Count + 1
ENDIF
$X = SETDEFAULTPRINTER($Printer[0])
RETURN

;********************************************************
:DeletePrinters

$Name=EnumKey($UserPrintKey, $NumUserPrint)
IF @ERROR=0
$Loop = 1
DO
IF SUBSTR($Name, $Loop, 1) = ","
$Printer[$Count] = $Printer[$Count] + "\"
ELSE
$Printer[$Count] = $Printer[$Count] + SUBSTR($Name, $Loop, 1)
ENDIF
$Loop = $Loop + 1
UNTIL $Loop > Len($Name)
$NumUserPrint = $NumUserPrint + 1
GOTO DeletePrinters
ENDIF
IF $Count > 0
$Count = 0
DO
$X = DELPRINTERCONNECTION($Printer[$Count])
UNTIL $Printer[$Count] = "" OR $Count > 28
ENDIF
RETURN

[ 25 October 2001: Message edited by: David Miller, Nextel ]