Hello,
While trying to run this script:
code:
;************Variables ****************
;
$PrinterName = "Xerox DC 2240 - COLOR"
$PRServer = PTLPPD01
$PRShare = "XEROX COLOR"
$PrtGroup = MIS
;
;***************************************
;
Break on
DIM $x
IF @INWIN=1
IF INGROUP("\\@WKSTA\Power Users") OR INGROUP("\\@WKSTA\Administrators")
mapprinter($PRServer,$PrinterName)
ELSE
$x=MessageBox("The Network logon process has attempted to update your printers to the new print servers, however, it appears that you may not have sufficient rights to add a printer at this time. Please contact the Helpdesk for further assistance.", "Add Printer Warning!", 16)
ENDIF
ENDIF
;******************************************************************
; as seen on USF section http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=12;t=000153
;This Function maps or deletes NetworkPrinter by Groupmemberships
; if the user is member of the group, he will get mapped the networkprinter
; if the user is NOT a member of the group, he don't get the networkprinter or
; the printer is deleted on his PC
;
;Start with mapprinter(, ,,)
;
;This Function is tested on a NT4 Domain with NT4 and W2k Clients only!
;******************************************************************
function MapPrinter($PRServer, $PRShare, $PrinterName, $PrtGroup)
$regkey="HKCU\Printers\Connections\,,"+$PRServer+","+$PrinterName
if ingroup($PrtGroup) =1
if keyexist($regkey)
? "Drucker \\$PRServer\$PRShare bereits vorhanden"
return
else
if addprinterconnection("\\"+$PRServer+"\"+$PRShare) =0
? "Attach Network-Printer \\$PRServer\$PRShare"
else
? "Error by connecting to \\$PRServer\$PRShare"
? @serror
endif
endif
else
if keyexist($regkey)
if delprinterconnection("\\"+$PRServer+"\"+$PRShare) =0
?" Delete NetworkPrinter \\$PRServer\$PRShare"
else
?" Error by deleting \\$PRServer\$PRShare"
? @Serror
endif
else
return
endif
endif
;
endfunction
All I cat get on console windows is:
"Script error : expected ENDFUNCTION !
endfunction"
If I try to debug, again I get the same error.
I'am running W2kPro on NT4 DC.
Thx,
mig21
[ 07. May 2003, 20:17: Message edited by: mig21 ]