mmuser
(Fresh Scripter)
2018-02-12 01:46 PM
Code

we use Kixtart 4.64 at WIndows 10 1709
In the printerscript i connect printers with:

AddPrinterConnection ("\\"+$printserver+"\DRU00016")

I get an error code 01722.

What means this Code ?


Mart
(KiX Supporter)
2018-02-12 02:32 PM
Re: Code

First question that comes up, are the drivers for using this printer on the client system available on the server?

AllenAdministrator
(KiX Supporter)
2018-02-12 02:59 PM
Re: Code

01722 is likely a bunch of return codes being sent to the screen.

Please change the line of code to this so we know what the error really is:

$RC=AddPrinterConnection ("\\"+$printserver+"\DRU00016")
? $RC
? @serror


mmuser
(Fresh Scripter)
2018-02-12 03:37 PM
Re: Code

If i connect to the printer manually - it runs - The driver is available on the Server

If i change the code i get the following error:

1722
The RPC-Server ist not available (i hope this is the translation)
In German: Der RPC-Server ist nicht verfügbar


Arend_
(MM club member)
2018-02-13 09:19 AM
Re: Code

In command prompt you can get the error code like this:
 Code:
net helpmsg 1722

The answer would be: "The RPC server is unavailable."
The reason you get a 0 in front with your code is because 0 is what is returned by AddPrinterConnection.
As Allen pointed out, you have to catch that with a variable, in his example $RC.
In Kix @ERROR returns the error code and @SERROR returns the error description.

The likely problem seems to be that the $printserver variable doesn't contain the right name.


mmuser
(Fresh Scripter)
2018-02-14 08:22 AM
Re: Code

Sorry i had an error in my script the variable %printserver% has the wrong name of the Printserver