Re: Enumerating Network Printers
- From: Tom Lavedas <tglbatch@xxxxxxx>
- Date: Fri, 8 Feb 2008 04:55:38 -0800 (PST)
On Feb 8, 6:44 am, Minja <Mi...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hello,
I would like to retreive a value of "Comment" field of network printers
installed on host machine using a Visual Basic Script.
Is it possible?
Thanks
Minja
From the MS Technet Script Center's Examples (slightly adapted andwith a little help from their scriptomatic.hta utility):
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root
\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer")
For Each objPrinter in colInstalledPrinters
s = s & "Name: " & objPrinter.Name & ", "
s = s & "Location: " & objPrinter.Location & ", "
s = s & "Default: " & objPrinter.Default & ", "
s = s & "Comment: " & objPrinter.Comment & vbCRLF
Next
wsh.echo s
TechNet Script Center Sample Scripts (URL all one line)
http://www.microsoft.com/downloads/details.aspx?FamilyID=b4cb2678-dafb-4e30-b2da-b8814fe2da5a
Scriptomatic 2.0
http://www.microsoft.com/downloads/details.aspx?FamilyID=09dfc342-648b-4119-b7eb-783b0f7d1178
Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
.
- Prev by Date: Re: Editing Personal Information
- Next by Date: Re: Automated Backup Help
- Previous by thread: why is this not working?
- Next by thread: change computer passwords in an OU
- Index(es):
Relevant Pages
|