S
stabilo
I'm using vbscript and XP prof.
I need to list all 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
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 ? Can I use wild caracters in getobject("WinNT://*,computer") ?
Maybe myt code is totally wrong ?
I'd like to have the same list than the Find Printer dialog box when I do
not specify anyt criterias
I need to list all 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
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 ? Can I use wild caracters in getobject("WinNT://*,computer") ?
Maybe myt code is totally wrong ?
I'd like to have the same list than the Find Printer dialog box when I do
not specify anyt criterias