SetDefaultPrinter Method of the Win32_Printer Class

The SetDefaultPrinter WMI class method sets the default system printer for the user calling the method.

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

Syntax

MOF
uint32 SetDefaultPrinter();

Parameters

This method has no parameters.

Return Value

Returns 0 (zero) if successful, and some other value if an error occurs.

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 clientWindows XP
Minimum supported serverWindows Server 2003
MOFCimwin32.mof
DLLCimwin32.dll
Namespace\root\cimv2

See Also

Computer System Hardware Classes
Win32_Printer

Send comments about this topic to Microsoft

Build date: 11/3/2009

Tags :


Page view tracker