There are two ways to open a Control Panel item:
- 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.
control.exe sysdm.cpl,,3
This topic discusses the following:
- Windows Vista Canonical Names
- New Commands for Windows Vista
- Legacy Control Panel Commands
- Related topics
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.
WinExec("%systemroot%\system32\control.exe /name Microsoft.WindowsUpdate", SW_NORMAL);
To start a Control Panel item with its canonical name, use: "%systemroot%\system32\control.exe /name canonicalName"
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"
An application can also implement the IOpenControlPanel::Open method to launch Control Panel items, including the ability to open a specific sub-page.
For a complete list of Control Panel item canonical names, see Canonical Names of Control Panel Items.
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:
Personalization
- Font size and DPI: %windir%\system32\DpiScaling.exe
- Screen resolution: %windir%\system32\control.exe desk.cpl,Settings,@Settings
- Display settings: %windir%\system32\control.exe desk.cpl,Settings,@Settings
- Themes: %windir%\system32\control.exe desk.cpl,Themes,@Themes
- Screensaver: %windir%\system32\control.exe desk.cpl,screensaver,@screensaver
- Multi-monitor: %windir%\system32\control.exe desk.cpl,Monitor,@Monitor
- Color Scheme: %windir%\system32\control.exe /name Microsoft.Personalization /page pageColorization
- Desktop background: %windir%\system32\control.exe /name Microsoft.Personalization /page pageWallpaper
Note Starter and Basic Editions do not support control.exe /name Microsoft.Personalization command.
System
- Performance: %windir%\system32\SystemPropertiesPerformance.exe
- Remote access: %windir%\system32\SystemPropertiesRemote.exe
- Computer name: %windir%\system32\SystemPropertiesComputerName.exe
- System protection: %windir%\system32\SystemPropertiesProtection.exe
- Advanced system properties: %windir%\system32\SystemPropertiesAdvanced.exe
Programs and Features
- Add or remove programs: %windir%\system32\control.exe /name Microsoft.ProgramsAndFeatures
- Windows features: %windir%\system32\OptionalFeatures.exe
Regional and Language Options
- Keyboard: %systemroot%\system32\control.exe /name Microsoft.RegionalAndLanguageOptions /page /p:"keyboard"
- Location: %systemroot%\system32\control.exe /name Microsoft.RegionalAndLanguageOptions /page /p:"location"
- Administrative: %systemroot%\system32\control.exe /name Microsoft.RegionalAndLanguageOptions /page /p:"administrative"
Folder Options
- Folder searching: %windir%\system32\rundll32.exe shell32.dll,Options_RunDLL 2
- File associations: %windir%\system32\control.exe /name Microsoft.DefaultPrograms /page pageFileAssoc
- View: %windir%\system32\rundll32.exe shell32.dll,Options_RunDLL 7
- General: %windir%\system32\rundll32.exe shell32.dll,Options_RunDLL 0
Power Options
- Edit current plan settings: %windir%\system32\control.exe /name Microsoft.PowerOptions /page pagePlanSettings
- System settings: %windir%\system32\control.exe /name Microsoft.PowerOptions /page pageGlobalSettings
- Create a power plan: %windir%\system32\control.exe /name Microsoft.PowerOptions /page pageCreateNewPlan
- There is no canonical command for the Advanced Settings page, it is accessed in the older manner: %windir%\system32\control.exe powercfg.cpl,,3
Legacy Control Panel Commands
When you use the WinExec function, the system can recognize special Control Panel commands. These commands predate Windows Vista.
| control.exe desktop | Launches the Display Properties window.
Note Starter and Basic Editions do not support this command. |
| control.exe color | Launches the Display Properties window with the Appearance tab preselected. |
| control.exe date/time | Launches the Date and Time Properties window. |
| control.exe international | Launches the Regional and Language Options window. |
| control.exe mouse | Launches the Mouse Properties window. |
| control.exe keyboard | Launches the Keyboard Properties window. |
| control.exe printers | Displays the Printers and Faxes folder. |
| control.exe fonts | Displays the Fonts folder. |
For Windows 2000 and later systems:
| control.exe folders | Launches the Folder Options window. |
| control.exe netware | Launches the Novell NetWare window (if installed). |
| control.exe telephony | Launches the Phone and Modem Options window. |
| control.exe admintools | Displays the Administrative Tools folder. |
| control.exe schedtasks | Displays the Scheduled Tasks folder. |
| control.exe netconnections | Displays the Network Connections folder. |
| control.exe infrared | Launches the Infrared Monitor window (if installed). |
| control.exe userpasswords | Launches the User Accounts window. |
Related topics
- Control Panel Items
- User Experience Guidelines
- Registering Control Panel Items
- Using CPLApplet
- Control Panel Message Processing
- Extending System Control Panel Items
- Assigning Control Panel Categories
- Creating Searchable Task Links for a Control Panel Item
- Accessing the Control Panel in Safe Mode under Windows Vista
Send comments about this topic to Microsoft
Build date: 3/7/2012
http://social.technet.microsoft.com/Forums/en-US/winserverGP/thread/1d698961-b605-496f-80ee-23da319f16a7
http://msdn.microsoft.com/en-us/library/ee330741(VS.85).aspx
If you were directed here while editing GPOs, there is no joy to be found here.
The Policies at User Configuration/Policies/Administrative Templates/Control Panel require specific values.
Here is what I can find so far by registry hacking.
Search for the values named "LocalizedString" under the following keys:
HKEY_CLASSES_ROOT\CLSID\CLSID -OR-
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID (same thing, doncha know!)
The names in the registry are not necessarily the same as the control panel applets! (thanks, MS)
You will need to use these for GPO restriction (in Vista; YMMV).
This took a LOT of work; I hope it helps someone.:
Add Hardware @%SystemRoot%\System32\hdwwiz.cpl,-1000
Administrative Tools @%SystemRoot%\system32\shell32.dll,-22982
AutoPlay @%SystemRoot%\System32\autoplay.dll,-1
Backup And Restore @%SystemRoot%\System32\brcpl.dll,-1
Bluetooth Devices @%systemroot%\system32\FunctionDiscoveryFolder.dll,-1500
Color Management @%SystemRoot%\system32\colorcpl.exe,-6
Default Programs @%SystemRoot%\system32\sud.dll,-1
Device Manager @%SystemRoot%\System32\devmgr.dll,-4
Game Controllers joy.cpl
Get Programs Online @%SystemRoot%\system32\appwiz.cpl,-1070
Indexing Options srchadmin.dll
Internet Options @C:\Windows\System32\inetcpl.cpl,-4312
iSCSI Initiator @C:\Windows\System32\iscsicpl.dll,-5001
Java @C:\Program Files\Java\jre6\bin\javacpl.exe,-1
Mail MLCFG32.CPL
Network and Sharing @%SystemRoot%\system32\netcenter.dll,-1
Offline Files cscui.dll
People Near Me collab.dll
Performance Information @%SystemRoot%\System32\PerfCenterCPL.dll,-1
Phone and Modem @C:\Windows\system32\telephon.cpl,-1
Pix Tools Pixmdlcn.cpl
Power Options @%SystemRoot%\System32\powercpl.dll,-1
Problem Reports @%SystemRoot%\System32\wercon.exe,-350
Programs and Features @%systemroot%\system32\appwiz.cpl,-159
Scanners and Cameras @%ProgramFiles%\Windows Photo Gallery\ImagingDevices.exe,-101
Scanners and Cameras @%SystemRoot%\system32\wiashext.dll,-331
Security Centre @%SystemRoot%\System32\wscui.cpl,-2001
Symantec Live Update @C:\Program Files\Symantec\LiveUpdate\S32LUCP1RES.DLL,-1
Sync Centre @%SystemRoot%\System32\SyncCenter.dll,-3000
System @%SystemRoot%\System32\systemcpl.dll,-1
Taskbar and Start Menu @%SystemRoot%\system32\shell32.dll,-32517
User Accounts @%SystemRoot%\System32\usercpl.dll,-1
Welcome Centre @%SystemRoot%\system32\oobefldr.dll,-33056
Windows Anytime Upg @%SystemRoot%\System32\windowsanytimeupgradecpl.dll,-1
Windows Cardspace @C:\Windows\System32\icardres.dll,-4097
Windows Defender @%ProgramFiles%\Windows Defender\MsMpRes.dll,-104
Windows Firewall @C:\Windows\system32\FirewallSettings.exe,-12122
Windows Sidebar Prop @%ProgramFiles%\Windows Sidebar\sidebar.exe,-11003
Windows SideShow @%SystemRoot%\System32\AuxiliaryDisplayCpl.dll,-1
Windows Update @%SystemRoot%\system32\wucltux.dll,-1