Page 1 of 1 1
Topic Options
#190786 - 2008-12-02 03:33 PM EnumPrinterConnections - Simple
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
There are already 2 UDF's basically doing the same thing, also using the same code generally but here is one clean and simple generating the same output as EnumGroup and using the same input.

 Code:
Function EnumPrinterConnections(Optional $index)
  Dim $WSHNetwork, $WSHPrinters
  $WSHNetwork = CreateObject("WScript.Network")
  $WSHPrinters = $WSHNetwork.EnumPrinterConnections
  If VarType($index) = 3
    $EnumPrinterConnections = $WSHPrinters.Item($index)
  Else
    $EnumPrinterConnections = $WSHPrinters.Count
  EndIf
EndFunction


no $index returns the amount of printers, a numeric $index return that printer's name.

Top
#190787 - 2008-12-02 06:53 PM Re: EnumPrinterConnections - Simple [Re: Arend_]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
I believe the two other UDF scripts are these

EnumPrinterConnections() - Another approach

EnumPrinterConnections2() - Enumerates all connected printers

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 581 anonymous users online.
Newest Members
Audio, Hoschi, Comet, rrosell, PatrickPinto
17880 Registered Users

Generated in 0.048 seconds in which 0.023 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org