| stabilo 2005-08-26, 6:55 pm |
| I'm using vbscript and XP prof.
I need to list the all the Print queues of our print servers, including the
printers shared by computer. In otherwords I need to have a list of all
printers avaiable in my network.
I have been using the following lines :
Set c = getobject("WinNT://servername,computer")
c.filter = array("Printqueue")
n=0
afile = "D:\output.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile(afile, True)
For each p in c
n = n + 1
Set pq = getobject(p.ADspath)
MyFile.WriteLine ("Print Queue " & Cstr(n) & ": " & pq.name & " " &
"Location : " &pq.location)
next
Myfile.close
Msgbox "Done"
This code will write in a text file the queues of my server servername, but
only for this specific server name and does not inlcude the printers shared
by computers.
How to do it ?
I'd like to have the same list than the Find Printer dislog box when I do
not specified anyt criterias.
|