Page 1 of 1 1
Topic Options
#75076 - 2003-05-20 08:04 PM AddPrinterConnection to local printer
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Got a bit of a tough one here, plus my hands are tied in terms of changing the existing login script. Scenario:

Each workstation in our domain has a machine variable that points to the print server and print share for that particular workstation. Its not important how we derive that variable, but for our purposes, lets call it $PRINTER and it would look like this:`

$PRINTER = "\\server\share"

well, our login script comes along and picks up this variable and uses it like this:

code:
If AddPrinterConnection($PRINTER)
; Show error
exit
EndIf

If SetDefaultPrinter($PRINTER)
; Show error
exit
EndIf

This logic works fine for remote printers. Even though the printer is already connected, etc ... the logic just goes past it and proceeds to set the printer as default. (By the way, we use roaming profiles so the need for this type of processing, people moving around and getting different maps based on where they are.

Now the problem, we're trying to integrate this environment to use LOCAL PRINTERS, printers simply connected to LPT1 ... and im banging my head against the wall trying to figure out how to make the login script work with this configuration. I definitely cannot change the login script - that is out of the question. So what im trying to do is somehow fake the AddPrinterConnection into working with the local printer.

I have already "shared-out" the local printer and used that name but I'm getting errors on that (error 123). I not sure if its possible to add a connection to a local printer share or not. So the logic im trying to use is:

$PRINTER = "\\@WKSTA\hpdeskjet"

$rs = AddPrinterConnection($PRINTER)

I dont even care if the AddPrinterConnection works, just want it to not error so that the login script will carry on to the SetDefaultPrinter. Might be screwed here. OS = NT. Kixvers = 3.54 (really old).

Top
#75077 - 2003-05-20 08:12 PM Re: AddPrinterConnection to local printer
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
How about this. Create a shared printer on a central print server that points back to the local workstation's printers. Then connect the user to the appropriate printer on the print server, which point back to the user's workstation.
_________________________
There are two types of vessels, submarines and targets.

Top
#75078 - 2003-05-20 08:13 PM Re: AddPrinterConnection to local printer
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22343
Loc: OK
shawn, make yourself being able to change the logonscript?
_________________________
!

download KiXnet

Top
#75079 - 2003-05-20 08:17 PM Re: AddPrinterConnection to local printer
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4482
Loc: USA
You might try my AddPrinter UDF as it supports all sorts of printers.

I'm surprised you cannot connect to a local printer share. I do this manually all the time for programs that do not recognize anything other than a lpt port.

Top
#75080 - 2003-05-20 08:18 PM Re: AddPrinterConnection to local printer
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Can't change the login scripts (in the short to medium term) because of all the change management that has to occur (really). Cant set anything up on servers for the same reason. I thought that sharing out the local printer would have nailed it ... hmmm ... does that make sense ?
Top
#75081 - 2003-05-20 08:21 PM Re: AddPrinterConnection to local printer
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
hmmm, yeah - maybe I am setting-up the local print share wrong, but didn't think much could go wrong there. al, do you have any code special code snippets for this, or is the syntax same for local and remote ?
Top
#75082 - 2003-05-20 08:29 PM Re: AddPrinterConnection to local printer
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6375
Loc: Stuttgart, Germany
Now I am confused [Confused]

Who else is better to change a logon script than you ?
Oh well, the same story here, we use the same old script designed around 3.47, abused and raped by many since years ... I gave up in wanting to rewrite it about 2 years ago [Frown]

Ok, what is the OS of the machine you share the printer ?
_________________________



Top
#75083 - 2003-05-20 08:32 PM Re: AddPrinterConnection to local printer
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Shawn is in the same boat that I am in with regard to PCM (Production Change Management).. However, I have been given some flexibility to create a test environment (separate scripts) to test out new ideas and things.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#75084 - 2003-05-20 08:35 PM Re: AddPrinterConnection to local printer
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22343
Loc: OK
shawn, you can get yourself a new project or get job for summer assistant by insisting that it will be changed!

my whole career (not sure how many days it will continue) in current company I have been fighting against things I have suspicion about.

just got our company against Archhhserve and about 2 years ago got win9x removed as a start.

you just say that it's impossible. that is keyword to everything.
and as you are da man, they will believe you [Wink]
_________________________
!

download KiXnet

Top
#75085 - 2003-05-20 08:37 PM Re: AddPrinterConnection to local printer
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4482
Loc: USA
Man... and I thought my environment was bad. Once the corporate script finishes, I have complete control over the logon script at our facility (WOOHAHAHA...) [Wink]

If you are limited in how much you can change things, I don't think the addprinter UDF is the way to go, as it requires a bit more configuration than the simplier AddPrinterConnection. [Frown]

Top
#75086 - 2003-05-20 08:38 PM Re: AddPrinterConnection to local printer
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Same here - I wrote our login scripts in 98/99 - and even though there has been many changes over the years, there never was a need to upgrade to the lastest and greatest (which we will be doing sometime later this year).

The problem is when you "hand-off" the scripts to the central admin types. A wall of change management is erected and you better have a darn good reason for wanting to change the script, or upgrading kix for that matter. Thousands of wkstns could be affected by some bad code.

To be honest - for our paranoid environment - im just warming-up to the idea that 4.21 is rock-stable enough to deploy in our environment. Especially given all the false starts from 4.02 to the present.

Top
#75087 - 2003-05-20 08:58 PM Re: AddPrinterConnection to local printer
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22343
Loc: OK
shawn, dad...

actually you are best of telling them that there needs to be change as something is impossible.

then add to the paper what the benefits are also.

they will join their heads and come up with "ja, sure do it."

after that you have free hands on it but make it adaptable!
make it such that you have at least some sort of control over it even though it might require sub-domain scripts but believe me, it will be worth it.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 156 anonymous users online.
Newest Members
Jodey, Hiker, GTRoberts, KatieQuinn, Brennnnn
17684 Registered Users

Generated in 0.038 seconds in which 0.012 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