Win32_Printer class 从WMI取到的打印机的属性信息,这一定是你想要找的
The Win32_Printer WMI class represents a device connected to a computer running on a Microsoft Windows operating system that can produce a printed image or text on paper or other medium.
The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties.
Syntax
class Win32_Printer : CIM_Printer
{
uint32 Attributes;
uint16 Availability;
string AvailableJobSheets[];
uint32 AveragePagesPerMinute;
uint16 Capabilities[];
string CapabilityDescriptions[];
string Caption;
string CharSetsSupported[];
string Comment;
uint32 ConfigManagerErrorCode;
boolean ConfigManagerUserConfig;
string CreationClassName;
uint16 CurrentCapabilities[];
string CurrentCharSet;
uint16 CurrentLanguage;
string CurrentMimeType;
string CurrentNaturalLanguage;
string CurrentPaperType;
boolean Default;
uint16 DefaultCapabilities[];
uint32 DefaultCopies;
uint16 DefaultLanguage;
string DefaultMimeType;
uint32 DefaultNumberUp;
string DefaultPaperType;
uint32 DefaultPriority;
string Description;
uint16 DetectedErrorState;
string DeviceID;
boolean Direct;
boolean DoCompleteFirst;
string DriverName;
boolean EnableBIDI;
boolean EnableDevQueryPrint;
boolean ErrorCleared;
string ErrorDescription;
string ErrorInformation[];
uint16 ExtendedDetectedErrorState;
uint16 ExtendedPrinterStatus;
boolean Hidden;
uint32 HorizontalResolution;
datetime InstallDate;
uint32 JobCountSinceLastReset;
boolean KeepPrintedJobs;
uint16 LanguagesSupported[];
uint32 LastErrorCode;
boolean Local;
string Location;
uint16 MarkingTechnology;
uint32 MaxCopies;
uint32 MaxNumberUp;
uint32 MaxSizeSupported;
string MimeTypesSupported[];
string Name;
string NaturalLanguagesSupported[];
boolean Network;
uint16 PaperSizesSupported[];
string PaperTypesAvailable[];
string Parameters;
string PNPDeviceID;
string PortName;
uint16 PowerManagementCapabilities[];
boolean PowerManagementSupported;
string PrinterPaperNames[];
uint32 PrinterState;
uint16 PrinterStatus;
string PrintJobDataType;
string PrintProcessor;
uint32 Priority;
boolean Published;
boolean Queued;
boolean RawOnly;
string SeparatorFile;
string ServerName;
boolean Shared;
string ShareName;
boolean SpoolEnabled;
datetime StartTime;
string Status;
uint16 StatusInfo;
string SystemCreationClassName;
string SystemName;
datetime TimeOfLastReset;
datetime UntilTime;
uint32 VerticalResolution;
boolean WorkOffline;
};
The Win32_Printer WMI class represents a device connected to a computer running on a Microsoft Windows operating system that can produce a printed image or text on paper or other medium.
The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties.
Syntax
class Win32_Printer : CIM_Printer
{
uint32 Attributes;
uint16 Availability;
string AvailableJobSheets[];
uint32 AveragePagesPerMinute;
uint16 Capabilities[];
string CapabilityDescriptions[];
string Caption;
string CharSetsSupported[];
string Comment;
uint32 ConfigManagerErrorCode;
boolean ConfigManagerUserConfig;
string CreationClassName;
uint16 CurrentCapabilities[];
string CurrentCharSet;
uint16 CurrentLanguage;
string CurrentMimeType;
string CurrentNaturalLanguage;
string CurrentPaperType;
boolean Default;
uint16 DefaultCapabilities[];
uint32 DefaultCopies;
uint16 DefaultLanguage;
string DefaultMimeType;
uint32 DefaultNumberUp;
string DefaultPaperType;
uint32 DefaultPriority;
string Description;
uint16 DetectedErrorState;
string DeviceID;
boolean Direct;
boolean DoCompleteFirst;
string DriverName;
boolean EnableBIDI;
boolean EnableDevQueryPrint;
boolean ErrorCleared;
string ErrorDescription;
string ErrorInformation[];
uint16 ExtendedDetectedErrorState;
uint16 ExtendedPrinterStatus;
boolean Hidden;
uint32 HorizontalResolution;
datetime InstallDate;
uint32 JobCountSinceLastReset;
boolean KeepPrintedJobs;
uint16 LanguagesSupported[];
uint32 LastErrorCode;
boolean Local;
string Location;
uint16 MarkingTechnology;
uint32 MaxCopies;
uint32 MaxNumberUp;
uint32 MaxSizeSupported;
string MimeTypesSupported[];
string Name;
string NaturalLanguagesSupported[];
boolean Network;
uint16 PaperSizesSupported[];
string PaperTypesAvailable[];
string Parameters;
string PNPDeviceID;
string PortName;
uint16 PowerManagementCapabilities[];
boolean PowerManagementSupported;
string PrinterPaperNames[];
uint32 PrinterState;
uint16 PrinterStatus;
string PrintJobDataType;
string PrintProcessor;
uint32 Priority;
boolean Published;
boolean Queued;
boolean RawOnly;
string SeparatorFile;
string ServerName;
boolean Shared;
string ShareName;
boolean SpoolEnabled;
datetime StartTime;
string Status;
uint16 StatusInfo;
string SystemCreationClassName;
string SystemName;
datetime TimeOfLastReset;
datetime UntilTime;
uint32 VerticalResolution;
boolean WorkOffline;
};
更多参考: [url=https://msdn.microsoft.com/zh-cn/library/aa394363.aspx]https://msdn.microsoft.com/zh-cn/library/aa394363.aspx[/url]
具体字段含义,请参看: https://msdn.microsoft.com/en-us/library/aa394363(v=vs.85).aspx