Page 1 of 1 1
Topic Options
#119308 - 2004-05-11 07:11 AM setdefaultprinter
munrom Offline
Lurker

Registered: 2004-05-11
Posts: 3
This is part of the code I have in my login script, that connects and set's the default printer, yes it is a small network

Code:

ADDPRINTERCONNECTION ("\\server\ypnt02")
ADDPRINTERCONNECTION ("\\server\fs-1800n")
SETDEFAULTPRINTER ("\\server\fs-1800n")



SETDEFAULTPRINTER returns error code 2, no premission problems as I can do it manually in windows, just the script errors, any ideas, I've tried just "fs-1800n" and the full display name and "\\server\full display name" all error with number 2

Top
#119309 - 2004-05-11 07:18 AM Re: setdefaultprinter
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
and if you do a net view on that print server the share shows up with the same name? There doesnt seem to be anything wrong with the code you posted. I think error 2 is 'The system cannot find the file specified', so more than likely the printer isnt getting created in the first place. Try something like this to see what all is happening..

Code:
ADDPRINTERCONNECTION ("\\server\ypnt02")
? ""+@Error+" - "+@SError
ADDPRINTERCONNECTION ("\\server\fs-1800n")
? ""+@Error+" - "+@SError
SETDEFAULTPRINTER ("\\server\fs-1800n")
? ""+@Error+" - "+@SError


Top
#119310 - 2004-05-11 07:34 AM Re: setdefaultprinter
munrom Offline
Lurker

Registered: 2004-05-11
Posts: 3
output of the code you posted is

Quote:


0
0 - The operation completed successfully.0
0 - The operation completed successfully.2
2 - The system cannot find the file specified.





I can see no reason for this to be happening, output of net view is

Quote:


FS-1800N - Print - Yellow Printer Kyocera FS-1800
YPnt02 - Print - Yellow Printer Colour RICOH CL3000DN Laser





Kix version is 4.02, going to try 4.22

[EDIT] just tried 4.22, exactly the same


Edited by munrom (2004-05-11 07:45 AM)

Top
#119311 - 2004-05-11 08:12 AM Re: setdefaultprinter
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
this is the obvious thing discussed lot on this board.
setdefaultprinter does not use printer's sharename but you need to set the printer default by it's name.

also, you should take a lookie at faq forum under "why does console display 1's and 0's (amongst others)"
_________________________
!

download KiXnet

Top
#119312 - 2004-05-13 01:49 AM Re: setdefaultprinter
munrom Offline
Lurker

Registered: 2004-05-11
Posts: 3
The thing is I tried every name I can think of to set this default printer

"Yellow Printer Kyocera FS-1800" Error 2
"Yellow Printer Kyocera FS-1800 on Server" Error 2
"\\server\fs-1800n" Error 2
"fs-1800n" Error 2

I'm out of ideas as to what name to use cause I've tried those and I have gotten nowhere.

I must be missing something simple but I've no idea what.

Ok solved it myself, it doesn't just use the printer name, infact Windows seems to use a naming system I had until no never seen.

"\\SERVER\Yellow Printer Kyocera FS-1800"

Here a suggestion so other people don't have a problem, stick this as an example in the manual or the forum FAQ, it's not obvious to user \\%servername%\%printername on server%


Edited by munrom (2004-05-13 01:55 AM)

Top
#119313 - 2004-05-13 02:15 AM Re: setdefaultprinter
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
The manual aready has examples and also states that it is the printer name that is required. Why would you not make the sharename and the printer name both the same?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


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

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.065 seconds in which 0.035 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