Paul,
This code gets a list of local printers:
using System;
using System.Management;
using System.Windows.Forms;
namespace WMISample
{
public class MyWMIQuery
{
public static void Main()
{
try
{
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\CIMV2",
"SELECT * FROM Win32_Printer");
foreach (ManagementObject queryObj in searcher.Get())
{
Console.WriteLine("-----------------------------------");
Console.WriteLine("Win32_Printer instance");
Console.WriteLine("-----------------------------------");
Console.WriteLine("Name: {0}", queryObj["Name"]);
}
}
catch (ManagementException e)
{
MessageBox.Show("An error occurred while querying for WMI
data: " + e.Message);
}
}
}
}
This are scrips that pull out printers fron AD, but you will need to convert
it:
http://www.microsoft.com/technet/scriptcenter/guide/sas_prn_wize.mspx?mfr=true
Sorry that I cannot be of any more help
--
Newbie Coder
(It's just a name)
Post by Paul SI need to get a list of printers in my C# application running on a server
including paper size, papaer source, driver name etc.
Do I use WMI or .. ?
--
Paul S