Page 1 of 1 1
Topic Options
#86518 - 2002-06-29 12:44 AM Printer Form
John Offline
Fresh Scripter

Registered: 2001-09-27
Posts: 38
Loc: Canada
I would like to create a form that will giver a user a listbox of all the printers available on a particular win2k server that they can connect to.

Is this possible with KixForms or KixGui??

thx in advance

John

Top
#86519 - 2002-06-29 01:53 AM Re: Printer Form
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Sure... you can try this:

code:
$oContainer = GetObject("LDAP://ou=Domain 
Controllers,dc=MyDomain,dc=com")
for each $oServer in $oContainer
? "Server: " + $oServer.Name
$oServer.Filter = "PrintQueue",""
for each $oPrinter in $oServer
? "Printer: " + $oPrinter.Name
next
next

There's your printer list. You can build your form around that. Also, you can give the user the option to map the printer with ADDPRINTERCONNECTION. If they're Wintendo you can shell it out...

code:
shell "%comspec% /c start '\\server\queue'"

That will start the add printer connection if they don't have it mapped (providing, of course you have the drivers setup on your print queue).

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 1808 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

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