

On Windows Vista, some options that were accessed by a. To open a specific sub-page in an item, or to open it with additional parameters, use: "%systemroot%\system32\control.exe /name canonicalName /page pageName"Īn application can also implement the IOpenControlPanel::Open method to launch Control Panel items, including the ability to open a specific sub-page.įor a complete list of Control Panel item canonical names, see Canonical Names of Control Panel Items. To start a Control Panel item with its canonical name, use: "%systemroot%\system32\control.exe /name canonicalName" WinExec("%systemroot%\system32\control.exe /name Microsoft.WindowsUpdate", SW_NORMAL)
#Window bash hide username and systemname update
The following example shows how an application can start the Control Panel item Windows Update with WinExec.

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.īy convention, the canonical name is formed as "CorporationName.ControlPanelItemName". The value of using a canonical name is that it abstracts the module name of the Control Panel item. A canonical name is a non-localized string that the Control Panel item declares in the registry. 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. For instance, the following example launches the fourth tab in the System item on Windows XP and the third tab on Windows Vista. 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. When a Control Panel item is opened through a command line, you can instruct it to open to a particular tab in the item. WinExec("c:\windows\system32\control.exe M圜pl.cpl", SW_NORMAL) The following example shows how an application can start the Control Panel item named M圜pl.cpl by using the WinExec function. WinExec("c:\windows\system32\control.exe", SW_NORMAL) The user or an application can start a Control Panel item by executing it directly from the command line prompt.Īn application can open the Control Panel programmatically by using the WinExec function.The user can open Control Panel and then open an item by clicking or double-clicking the item's icon.

There are two ways to open a Control Panel item: If you are looking for the list of canonical and module names for Control Panel items, see Canonical Names of Control Panel Items.
