|
|
|||||||
Hi all, i have a problem with the ADDPRINTERCONNECTION command. I wanna map 2 Printers to a special group. Can someone post me the code here? I´ve tested so many codes but nothing works. How does it work to get an error when the connection to the printer is failed? PS: Sorry for my bad english but i´m from germany Best wishes Backfight |
||||||||
|
|
|||||||
Code: ;Script Options If NOT @LOGONMODE Break On EndIf Dim $RC $RC=SetOption("Explicit", "On") $RC=SetOption("NoMacrosInStrings", "On") $RC=SetOption("NoVarsInStrings", "On") $RC=SetOption("WrapAtEOL", "On") ;Map Printer If InGroup("GroupName") $RC = AddPrinterConnection("\\Servername\PrinterShareName") EndIf |
||||||||
|
|
|||||||
Hello there, thanks for the early answer. But it doesn´t work. What i´m making worng? What must be configured on the server so that that script work Coretly? Thanks for your help Best wishes Backfight |
||||||||
|
|
|||||||
I've amended Witto's code so that it returns an error if the mapping fails: Code: ;Script Options If NOT @LOGONMODE Break On EndIf Dim $RC $RC=SetOption("Explicit", "On") $RC=SetOption("NoMacrosInStrings", "On") $RC=SetOption("NoVarsInStrings", "On") $RC=SetOption("WrapAtEOL", "On") Dim $sPrintServer $sPrintServer="ServerName" Dim $sPrinterName $sPrinterName="PrinterName" ;Map Printer If InGroup("GroupName") $RC = AddPrinterConnection("\\"+$sPrintServer+"\"+$sPrinterName) If @ERROR "ERROR: Cannot map printer "+$sPrinterName+" on "+$sPrintServer+" Reason: ["+@ERROR+"] "+@SERROR+@CRLF EndIf EndIf Make sure that the printer name and the share name are identical on the print server, otherwise it will cause you problems. |
||||||||
|
|
|||||||
Yes! It works!Thanks a lot! But there comes a beep! Does this mean there is an error? |
||||||||
|
|
|||||||
now the only thing i need is the command to set one of the printers to default printer |
||||||||
|
|
|||||||
All the commands is in the command reference. |
||||||||
|
|
|||||||
Yes but how to code it in this especial example? Sorry but i´m a newbie in kixtart |
||||||||
|
|
|||||||
$RC = SetDefaultPrinter("\\"+$sPrintServer+"\"+$sPrinterName) |
||||||||
|
|
|||||||
Ok and how do i get the printers removed? Excample: Some user wanna login but he issen´t in a group that gets printers. But he get! How can i say this user must not get any printer? Thanks 4 Help |
||||||||
|
|
|||||||
I do not get this one. Printers added with "AddPrinterConnection()" are added per user, not per computer. DelPrinterConnection() |
||||||||
|
|
|||||||
Some users without any dedicated printers get without any reason some printers from another group. Excample: Group xy get the Printer HP Laserjet 5 Group ab get no Printer If any user frome group ab is registrated he get without any reason dedicated one printer from group xy Hope you understand me right Sorry 4 my bad english |
||||||||
|
|
|||||||
There is always a reason. I don't understand it. |