|
|
|||||||
Hello all, I'm having a problem creating a default printer for a workstation that is a local printer to another workstation. I've tried using the @userid as well as the @wrksta, but the printer does not install. Is this correct? if @WKSTA = Workstation7 AddPrinterConnection ("\\Workstation8\hp LaserJet 1000") SetDefaultPrinter ("\\Workstation8\hp LaserJet 1000") ? "Added printer connection...." Endif Thanks |
||||||||
|
|
|||||||
What exactly is the problem? When using an IF construct, you should also use the ELSE for debugging to see if your IF is being evaluated as you expect. You also should evalute the return code from ADDPRINTERCONNECTION. See the documentation for details. SETDEFAULTPRINTER also returns the errcode of the operation. You evalute it also. See the example in the docs. Workstation7 should have quotes around it. |
||||||||
|
|
|||||||
Thanks for the response Howard, The problem is that the printer does not create.. I have used the same code for a user and it works ok. Can anyone recommend a good (easy to read) kix book? |
||||||||
|
|
|||||||
think this might be the easiest: http://www.amazon.com/exec/obidos/tg/detail/-/B0000W86HC/102-4286701-6303356?v=glance |
||||||||
|
|
|||||||
First off, can yuou connect to the printer by browsing to it? |
||||||||
|
|
|||||||
and secondly first off, what's the printer's share name. |
||||||||
|
|
|||||||
Hey, I was getting to the second (share) part. |
||||||||
|
|
|||||||
I can browse and connect to it no problem, The share name is hp Laserjet 1000 which is the same as the printer name. I have exactly the same script for another user and they connect fine. Thanks |
||||||||
|
|
|||||||
Have you checked the event logs on the machine in question? Perhaps the user is not able to update the printer drivers on the local machine. Check the return value (or @ERROR) after calling the functions. If there is an error then display it. If the success of a function or command is important to you then you must check the status and react accordingly. |