Page 1 of 1 1
Topic Options
#85044 - 2002-02-01 06:13 PM AddPrinterConnection() for Windows 9x ?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Guys,

I found this interesting snippet of code and I thought maybe someone would be interested in creating a new UDF for adding printer connections to Windows 9x machines ? I don't have any 9x boxes to test this against, so im just tossing this out for any ambitious person ...


Set WshNetwork = WScript.CreateObject("WScript.Network")
PrinterPath = "\\printserv\DefaultPrinter"
PrinterDriver = "Lexmark Optra S 1650"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver

-Shawn

Top
#85045 - 2002-02-01 09:39 PM Re: AddPrinterConnection() for Windows 9x ?
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
M$ DID THIS ???????????
Too bad the last 9x workstation goes to NT (What, got bored with 9x gameboys ? Nah)

Shawn, did you notice this one ?
[from the msdn site]
In Windows 95/98 the printer driver must already be installed on the machine in order for the AddWindowsPrinterConnection method to work. If the driver is not installed Windows will return the error message "Unknown printer driver".
[/msdn]

[ 01 February 2002: Message edited by: Alex.H ]

_________________________
? getobject(Kixtart.org.Signature)

Top
#85046 - 2002-02-01 09:58 PM Re: AddPrinterConnection() for Windows 9x ?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
DOH !!!

yap - your right - why does "everyone" shy away form the implementing the AddPrinterDriver() windows API ? Is there no DOS command or reskit util that will install a printer on Windows 9x ? Looks as if only two api calls would be needed for this to work.

oh well ~ never mind.

-Shawn

Top
#85047 - 2002-02-01 11:21 PM Re: AddPrinterConnection() for Windows 9x ?
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
In fact, i never see M$ adding a api command to install the drivers. I think there's a way to hack this in the addprinter wizard in 9x, but never really dig in this one.

On the other hand, if the drivers support silent install, you can use this one, but not so easy as NT addprinterconnection.

_________________________
? getobject(Kixtart.org.Signature)

Top
#85048 - 2002-02-02 01:33 AM Re: AddPrinterConnection() for Windows 9x ?
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
MS actively represses network functionality from wintendo clients.

You want management, upgrade...

however, many drivers support the *.inf install routine, you may be able to whach that mole on the head.

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#85049 - 2002-02-02 01:46 AM Re: AddPrinterConnection() for Windows 9x ?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I was refering specifically to this api:

AddPrinterDriver

Top
#85050 - 2002-02-02 02:15 AM Re: AddPrinterConnection() for Windows 9x ?
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
pName : Windows 95/98/Me: This parameter must be NULL. The AddPrinterDriver function can only install local printer drivers

Same for the Getprinter... and others

M$ can really get boring sometimes

_________________________
? getobject(Kixtart.org.Signature)

Top
#85051 - 2002-02-02 02:31 AM Re: AddPrinterConnection() for Windows 9x ?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
You gotta dig deep

HOWTO: Add a Network Printer Connection (Q147202)

Actually, we've discussed this article/topic on the board before. I can see why nobody wants to implement though.

-Shawn

[ 02 February 2002: Message edited by: Shawn ]

Top
#85052 - 2002-02-02 04:03 AM Re: AddPrinterConnection() for Windows 9x ?
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
In fact, i sent this link to Ruud some month ago, to ask if it was possible to add partial support for 9x. No answer actually.

Between, i was talking about another one that i don't found anymore, but i've found this
ONE

[ 02 February 2002: Message edited by: Alex.H ]

_________________________
? getobject(Kixtart.org.Signature)

Top
Page 1 of 1 1


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

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.049 seconds in which 0.024 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