In this article

The user can open Control Panel and then open an item by clicking or double-clicking the item's icon.

The user or an application can start a Control Panel item by executing it directly from the command line prompt.

An application can open the Control Panel programmatically by using the WinExec function.

WinExec("c:\windows\system32\control.exe", SW_NORMAL);

The following example shows how an application can start the Control Panel item named MyCpl.cpl by using the WinExec function.

WinExec("c:\windows\system32\control.exe MyCpl.cpl", SW_NORMAL);

When a Control Panel item is opened through a command line, you can instruct it to open to a particular tab in the item. Due to the addition and removal of certain tabs in some Windows Vista Control Panel items, the numbering of the tabs might have changed from that in Windows XP. For instance, the following example launches the fourth tab in the System item on Windows XP and the third tab on Windows Vista.

Windows Vista Canonical Names

In Windows Vista and later, the preferred method of launching a Control Panel item from a command line is to use the Control Panel item's canonical name. A canonical name is a non-localized string that the Control Panel item declares in the registry. The value of using a canonical name is that it abstracts the module name of the Control Panel item. An item can be implemented in a .dll and later be reimplemented as a .exe or change its module name. As long as the canonical name remains the same, then any program that opens it by using that canonical name does not need to be updated.

By convention, the canonical name is formed as "CorporationName.ControlPanelItemName".

The following example shows how an application can start the Control Panel item Windows Update with WinExec.

New Commands for Windows Vista

On Windows Vista, some options that were accessed by a .cpl module on Windows XP are now implemented as .exe files. This provides added security by allowing standard users to be prompted to provide administrator credentials when trying to launch the files. Options that do not require extra security are accessed by the same command lines that were used in Windows XP. The following is a list of commands used in Windows Vista to access specific tabs of Control Panel items: