I'm going to be adding new printers to user workstations when they run a script.
My thought was to originally remove all printers, mark the registry I've already done the remove all, then add the printer/s the user wants.
One issue I'm having is... How do I prevent items from being deleted, such as:
WinFax Pro Adobe Acrobat Printer PDF Broderbund PDF Creator AutoCAD X-Ref etc...
I want to remove all the printer connections,(except for special drivers that are not real printers) and add in the new printers that are now on a new server and a new path.
Here is what I'm currently doing to add the printer, currently no removal code.... for old printers.
Break on DIM $x IF @INWIN=1 IF INGROUP("\\@WKSTA\Power Users") OR INGROUP("\\@WKSTA\Administrators") AddNetworkPrinter($Server, $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
Function AddNetworkPrinter($Server, $PrinterName) Dim $Server, $PrinterName If ADDPRINTERCONNECTION("\\$Server\$PrinterName") = 0 ? "Added printer connection...$PrinterName" ? "Error level is: "+@ERROR +" "+@SERROR Endif EndFunction
[ 06. March 2003, 01:00: Message edited by: NTDOC ]
|