473,394 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Problem locating all Printers in computer...

Hi,
I'm trying to loop through all the printers in my computer system using WMI.

However, I found out that it doesn't really get the correct number of
printers in my system.

I have 16 printers in my printers & faxes. However, when I use the WMI to
retrieve the printers in my system, it only retrieve 13 printers instead of
16.

Does anyone know why is this so and how to resolve this issue?

Regards
Vanessa
Nov 20 '05 #1
3 1063
* "Vanessa" <va*****@eclinic.com.sg> scripsit:
I'm trying to loop through all the printers in my computer system using WMI.

However, I found out that it doesn't really get the correct number of
printers in my system.

I have 16 printers in my printers & faxes. However, when I use the WMI to
retrieve the printers in my system, it only retrieve 13 printers instead of
16.


Post your code.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
security. It's possible that for some users, the given printers are not
accessible.

ps: no need to cross post.
"Vanessa" <va*****@eclinic.com.sg> wrote in message
news:eu****************@TK2MSFTNGP10.phx.gbl...
Hi,
I'm trying to loop through all the printers in my computer system using WMI.
However, I found out that it doesn't really get the correct number of
printers in my system.

I have 16 printers in my printers & faxes. However, when I use the WMI to
retrieve the printers in my system, it only retrieve 13 printers instead of 16.

Does anyone know why is this so and how to resolve this issue?

Regards
Vanessa

Nov 20 '05 #3
Dim strPrintServer As String

strPrintServer = "localhost"

Dim WMIObject As String, PrinterSet As Object, Printer As Object

WMIObject = "winmgmts://" & strPrintServer

PrinterSet = GetObject(WMIObject).InstancesOf("win32_Printer")

For Each Printer In PrinterSet

MsgBox(PrinterStatusToString(Printer.printerstatus ))

End If

Exit Function

End If

Next Printer

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
* "Vanessa" <va*****@eclinic.com.sg> scripsit:
I'm trying to loop through all the printers in my computer system using WMI.
However, I found out that it doesn't really get the correct number of
printers in my system.

I have 16 printers in my printers & faxes. However, when I use the WMI to retrieve the printers in my system, it only retrieve 13 printers instead of 16.


Post your code.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Vanessa | last post by:
Hi, I'm trying to loop through all the printers in my computer system using WMI. However, I found out that it doesn't really get the correct number of printers in my system. I have 16...
4
by: Johnny Hu | last post by:
my program needs to print monthly bills i want to print bill and bill details on two printers synchronous how to find the two printers installed on computer and control them to print together? ...
1
by: jay | last post by:
Hello, The problem: When in the print screen to print an Access 97 report, in the printer drop-down list, there is only one printer shown, but it is not the printer I want to print to. There...
1
by: PCB | last post by:
Hi all! I have a subroutine that prints reports on a specific printer. The code works fine as long as all the printers available to the computer are on the network. However, if the computer also...
2
by: Tessa | last post by:
Hi, We have a .net web application, and are trying to use PrinterSettings.InstalledPrinters to list the printers installed on the webserver. (Windows 2003 server R2, IIS 6, .net framework 2.0.)...
5
by: lmttag | last post by:
ASP.NET 2.0 (C#) application Intranet application (not on the Internet) Using Windows authentication and impersonation Windows Server 2003 (IIS6) Server is a member server on a domain Logged...
5
by: itfetish | last post by:
I have made an electronic sign out book for my office in ASP using VBScript. Problem is, when there is a fire we need to check who is out and who is burning. I have been trying to think of how...
2
by: nikkysetyawan | last post by:
Hi, Anyone can help me in VB? I've 2 computers, First Computer have 3 Serial port printer attached to COM1,COM2,and COM3. The Second computer doesn't have any printer. Can anyone tell me the...
0
by: wheeto | last post by:
hi, when i use my.computer.printers all i get is an error, what am i doing wrong it doen't see .printer on intellisense, this is the code i am trying it with, Public Class Form1 Private...
2
by: wassimdaccache | last post by:
Hello everybody I do have a form called invoices I'm using a this code to print a report called invoices DoCmd.OpenReport "Invoices", acViewPreview, "", "!!=", acHidden I do have 2...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.