473,382 Members | 1,204 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,382 software developers and data experts.

ManagementObjectSearcher("Select * from Win32_Printer")

Hello all...

My application uses custom reports from Microsoft's report viewer and not
Crystal Reports. My understanding is there is no way to make the printdialog
select a different printer than the default via code, right?

So - here's what I have my app doing to fix the issue - There's a form the
user can load that performs the
ManagementObjectSearcher("Select * from Win32_Printer")
command. It will load all the printers on the computer into a drop-down
box. The user can then select the printer for each different report and
click save on the form to write the selections to the config.

When the user then runs that report, the computer performs the
ManagementObjectSearcher("Select * from Win32_Printer")
command again to determine the default printer on the computer, stores THAT
printer into memory, pulls the correct printer selection from the config file
and sets that one as the default printer. After the report is either printed
or cancelled, it returns the default printer back to the original selection.

MY QUESTION IS: If a network computer is off, the printer is offline.
Everytime I run the command to search for the computers printers, it takes
awhile. Is there a way to avoid waiting for the printer to repsond as
offline??

Thank you and sorry for the long story!!

Nov 3 '06 #1
0 2861

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

Similar topics

0
by: Winterminute | last post by:
I am trying to read a list of install programs using WMI with ASP.NET/C#. However, it fails with "Invalid Class". I have confirmed that if I query LOCALHOST then it works fine, but if I query a...
7
by: =?Utf-8?B?YXVsZGg=?= | last post by:
hello, i'm try to research the way to open a remote machine's to collect the services and processes. i have the local data collection running but i can not figure out what MSDN or the C# help file...
1
by: William Cruz | last post by:
Can anyone help me with this piece of code. - I keep on getting the error message "The object exporter specified was not found" If i change it to run on my local machine it works fine, the...
4
by: Rasarx | last post by:
Being new to VB, I'm trying to understand what a construct like means and how to use it. I thought anything with brackets is an escaped variable to allow using keywords like boolean, as in . But I...
0
by: kimiraikkonen | last post by:
Hello, I wanted query my CPU's temperature using this WMI code, but it always gives error "not suppored" as exception. I can monitor my Intel P4 Socket 478 CPU's temp with the softwares supplied...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.