#75076 - 2003-05-20 08:04 PM
AddPrinterConnection to local printer
|
Shawn
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
|
|
|
|
#75082 - 2003-05-20 08:29 PM
Re: AddPrinterConnection to local printer
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
#75083 - 2003-05-20 08:32 PM
Re: AddPrinterConnection to local printer
|
Kdyer
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
|
Top
|
|
|
|
#75085 - 2003-05-20 08:37 PM
Re: AddPrinterConnection to local printer
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
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...)
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.
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 369 anonymous users online.
|
|
|