473,797 Members | 3,204 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1099
* "Vanessa" <va*****@eclini c.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*****@eclini c.com.sg> wrote in message
news:eu******** ********@TK2MSF TNGP10.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(WMIOb ject).Instances Of("win32_Print er")

For Each Printer In PrinterSet

MsgBox(PrinterS tatusToString(P rinter.printers tatus))

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*****@eclini c.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
1491
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 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.
4
3859
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? regards, Johnny Hu.
1
1283
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 are multiple printers installed on this computer. I cannot find a way to make all the printers set up on the computer show in the Access 97 screen. This problem is only occuring in one profile. I've deleted the profile and reloaded it with no...
1
18359
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 has a local printer, the report is prints locally. What I'm I doing wrong! The complete subroutine follows: Private Sub PrintReport(strReportName As String) On Error GoTo PrintReport_Err
2
6225
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.) The printers installed on the web server under the account used by asp.net for this web application are network printers that are shared by other computers that are on our domain. Permission has been granted for everyone to print to them. The...
5
6690
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 into server as a domain user that is in the local Administrators group on the server Workstation is on the same domain Logged into the workstation as a domain user, which is also in the local Administrators group on the server and workstation
5
4181
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 to go about this, perhaps the only way is by having an 'emergency print' button that quickly prints thedocument to one, or even better all printers on the network. That way when everyone is leaving they can grab the print from the printer.
2
1236
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 code so the second computer can print To the printers with different job at the same time when I click a command button. eq: To printer at COM1: Print text = "aaa", To printer at COM2 Print text = "bbb". Usually I used: Open "COM1" for output #1...
0
912
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 Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load With My.Computer.Printers.DefaultPrinter .HorizontalAlignment = HorizontalAlignment.Center
2
4471
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 printers installed in my computer "HP" and "Epson " How can I ask user before he prints the invoices report to chose which printer want to use ...??? is there any method that can find all printers installed on the computer and let user choose the one...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10469
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10209
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10023
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9066
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7560
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6803
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4135
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2934
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.