In need to get a list of printers that are available on a print server (i.e. net view \\servername) and have VB be able to show the list in a listbox/textbox.
Hope you can help!
Chad
Printable View
In need to get a list of printers that are available on a print server (i.e. net view \\servername) and have VB be able to show the list in a listbox/textbox.
Hope you can help!
Chad
Is not very nice but a quick way would be to do this
shell("net view \\server > c:\nnn.txt")
Open "c:\nnn.txt" For Input As #1
do while not eof(1)
Line Input #1, linedata
t_pos = InStr(1,linedata," Print ")
if t_pos <> 0
combo1.add trim(left(linedata,20))
endif
loop
Take a look at an excellent piece of code at:
http://www.mvps.org/vbnet/code/enums/enumprinters.htm
Hope this helps
Simon