Page 1 of 1 1
Topic Options
#148254 - 2005-09-21 08:23 PM Documentation: clarify SetDefaultPrinter and AddPrinterConnection
reedmikel Offline
Fresh Scripter
**

Registered: 2005-09-21
Posts: 27
As a KiX newbie(but a longtime assembler/FoxPro/C programmer)I spent many hours trying to get SetDefaultPrinter("Printer name") to work as described in the docs. The paragraph that explains the parameter "Printer name" seems inaccurate, as it tells you to use "\\servername\sharename" if you previously added a printer with AddPrinterConnection("Printer name"). I spent many hours before I found out the correct syntax is SetDefaultPrinter("\\servername\printer's name"). Using "\\servername\sharename" does not work - it returns error code 2.

Suggestion: rewrite the explanation of the "Printer name" parameter for BOTH commands, something like follows:

AddPrinterConnection:
Parameters:
Printer name: string that specifies the fully qualified(UNC) name of the shared printer, in the format "\\servername\sharename"

Note that, unlike the SetDefaultPrinter("Printer name") command, the "Printer name" parameter used in AddPrinterConnection is the shared name of the printer, not the actual name of the printer.


SetDefaultPrinter:
Parameters:
Printer name: string that specifies the actual name of the printer, in a fully qualified(UNC) format such as "\\servername\printer's name".

Note that, unlike the AddPrinterConnection("Printer name") command, the "Printer name" parameter used in SetDefaultPrinter is the name of the printer, not the shared name of the printer. The printer's actual name is displayed on the General tab of the Properties for that printer.




Thanks!

Top
#148255 - 2005-09-21 09:31 PM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
To avoid any further confusion, I suggest minor ammendments to the above. AddPrinterConnection() should make no mention of a "Printer Name" at all, simply the "Share Name". Likewise, the inverse is true for SetDefaultPrinter() whereby there should be no reference to "Share Name" except to describe its differences in comparison to AddPrinterConnection().

Thanks for the suggestion
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#148256 - 2005-09-21 10:53 PM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
reedmikel Offline
Fresh Scripter
**

Registered: 2005-09-21
Posts: 27
Thanks - that's all I was hoping for when I originlly posted my comments in the Newbie forum. I did not want to inflame anybody
Top
#148257 - 2005-09-22 12:28 AM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I say don't change anything but the setdefaultprinter parameter's side note.
it says sharename. change that to printername.

and rest is fine.
_________________________
!

download KiXnet

Top
#148258 - 2005-09-22 07:28 AM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
reedmikel Offline
Fresh Scripter
**

Registered: 2005-09-21
Posts: 27
I like Les's idea, it makes it crystal clear that there is a difference between a printer name and a share name...
Top
#148259 - 2005-09-22 11:11 AM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
so les' idea would be to change the note line and then add at later on some sort info box that addprinterconnection and setdefaultprinter are not the same...

well...
_________________________
!

download KiXnet

Top
#148260 - 2005-09-22 03:40 PM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
reedmikel Offline
Fresh Scripter
**

Registered: 2005-09-21
Posts: 27
If I understood Les' suggestion, I think he was suggesting to change the docs for AddPrinterConnection("Printer name") to become AddPrinterConnection("\\servername\share name"). Part of the confusion for me was that both commands had the exact same parameters name of "Printer name". Yet only one was truly a printer name - the other was a share name...
Top
#148261 - 2005-09-22 07:00 PM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Guess I was just lucky. Even back in the 3.x days and having 4,000+ printers we used Cartoon character names for the printers and gave the shares the same name (even without knowing KiXtart worked this way). Just seemed natural to have the shares the same name as the printers to us. I never did like naming printers the name of the MFG or similar like I see a lot of people doing.

But I agree that there has been many noobie tripped up by this and have posted hundreds of posts on why it isn't working.

Top
#148262 - 2005-09-22 09:04 PM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Indeed naming the printers and the shares the same feels natural to me too. I got this from my previous job previous sysadmin (happens to be iffy, also a member of Korg) and just kept it up cause it worked great and felt ok. We never had any problems with it.
All was setup by a standard naming rule xxx(for city location) xxx (for type or department) xx (two numbers) so AMSPRN01 would be for Amsterdam-Printer-One and ROTMRK01 would be for Rotterdam-Marketing Workstation-One.

Names like HP_LJ4050_Sales_blah_evenmoreblah suck imho.

But the manual could be a little clearer on this I think.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#148263 - 2005-09-22 10:31 PM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
iffy Offline
Starting to like KiXtart

Registered: 2005-05-29
Posts: 149
Loc: The Netherlands
Hmm.. and shouldn't it be mentioned that I sorta introduced you to KiX

Btw.. what are ya doing these days Mart now the big blue D is not more?


Edited by iffy (2005-09-22 10:32 PM)

Top
#148264 - 2005-09-22 10:32 PM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Please refrain from chit-chat in the suggestions forum.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#148265 - 2005-09-22 10:56 PM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Ok, sorry.
Iffy check your PM's.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#148266 - 2005-09-23 10:15 AM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the manual has been updated.
see the next version of manual if the change suites everyone.
_________________________
!

download KiXnet

Top
#148267 - 2005-10-18 03:49 PM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
Bamse Offline
Lurker

Registered: 2005-10-18
Posts: 2
To bring this post alive again, but with a bit of a different touch.

Why use separate "naming convntions" on such related operations? Why not use the share name on both functions?
In my case, where I often come in to already existing environments with well established names and shares (as in "cannot change either") and help with moving shared printers from one server to another, it's really a hassle if I do not want to hardcode printer names in the script (which I really want to avoid due to the production of a quite generic script what will work at different companies with only a small change)

My suggestions is to change the function SetDefaultPrinter so that the function will accept and make use of the share name.
If this is an addition of functionality (both share and printer name will work) or if it is a replacement so only share name will work ... well. I don't really mind ...

Is there any room or similar for this?

Top
#148268 - 2005-10-18 07:42 PM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I think the problem is that kixtart uses windows api with it's printer functions and setdefaultPrinter there uses the printername.

to work around this, kixtart could no longer use the api as such but would need to do some sort of connected printer enumeration and so on.
if this is a hazzle for ruud, he can decide.

anyway, accepting sharename and printername is not an option as it would introduce a "ideal bug"
that is, if someone has a printer with sharename AAA and printername of BBB and another printer with sharename of CCC and printername AAA it wouldn't work reliably.
_________________________
!

download KiXnet

Top
#148269 - 2005-10-18 08:52 PM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Quote:


....
if someone has a printer with sharename AAA and printername of BBB and another printer with sharename of CCC and printername AAA it wouldn't work reliably.





That would be a rare case on printservers (and kind of a dumb action to do) but in basics you're right. People are creatures with an unpredictable mind so anything can happen.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#148270 - 2005-10-19 12:32 AM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well.
rare does not excuse for a bug.

and afaik, I have had such a thing in the past (not 100% sure though) and I can think up really good reasons for doing just that.
_________________________
!

download KiXnet

Top
#148271 - 2005-10-24 09:31 AM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
Bamse Offline
Lurker

Registered: 2005-10-18
Posts: 2
thanks for all the info!

jooel: i did supect kix was using api calls etc, but my suggestions stands

Top
#148272 - 2006-02-17 06:02 AM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
Oggie Offline
Lurker

Registered: 2005-05-03
Posts: 4
Loc: Perth, Western Australia
Has this changed at all in 4.50? I have been using AddPrinterConnection/DelPrinterConnection/SetDefaultPrinter using the same printer names (e.g. \\Server\Long Printer Name). Our share names are short 8 character names that don't always match the first 8 characters of my Long Printer Names. My scripts "APPEAR" to be working??? Am I doing this wrong?
Top
#148273 - 2006-02-17 09:53 AM Re: Documentation: clarify SetDefaultPrinter and AddPrinterConnection
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
no, functioning of the the functions have not changed.
the documentation has.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 707 anonymous users online.
Newest Members
min_seow, Audio, Hoschi, Comet, rrosell
17881 Registered Users

Generated in 0.077 seconds in which 0.046 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org