0 out of 3 rated this helpful - Rate this topic

AddPrinterDriver method of the Win32_PrinterDriver Class

Applies to: desktop apps only

The AddPrinterDriver class method creates a new printer driver.

Note  When using the AddPrinterDriver method you must use SeLoadDriverPrivilege to load or unload a device driver.

This topic uses Managed Object Format (MOF) syntax. For more information about using this method, see Calling a Method.

Syntax

uint32 AddPrinterDriver(
  [in]  Win32_PrinterDriver DriverInfo
);

Parameters

DriverInfo [in]

Information needed to create the printer driver.

Return value

Return codeDescription
0

Success.

5

Access denied.

1797

The printer driver is unknown.

 

Examples

For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.

For C++ code examples, see WMI C++ Application Examples.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Namespace

\root\CIMV2

MOF

Cimwin32.mof

DLL

Cimwin32.dll

See also

Computer System Hardware Classes
Win32_PrinterDriver

 

 

Send comments about this topic to Microsoft

Build date: 3/9/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Return code 87
Don't forget the "\" on the end of the "FilePath" attritube, or you'll get error 87 too.
Return Code 87
If you get code 87 check that the Name attribute is the same as the model specified in the inf file
Return code 87
Return Code 87 The parameter is incorrect. When driver object is not correctly filled or when driver can not be found in the system.
Example code?
Surely it's not unreasonable for customers to expect some sample code demonstrating how to use this most obtuse method?