Wednesday, February 17, 2010

Windows XP Control Panel, Shortcuts and Control.exe

Windows XP Control Panel, Shortcuts and Control.exe

As the name suggests, Control Panel is where many important system settings can be changed or adjusted. Since so many vital functions can be found there, it is worth looking at some aspects of how it works. We will also consider some ways of quickly accessing this very important system area. Going over the entire panoply of functions is too much for a single article but shortcuts for a few frequently used functions are given.


The standard way to open Control Panel is through Start-Control Panel. There are two methods of displaying the contents. One is called the "Category View" and displays tasks by generalized categories as shown in the figure below.

Choosing a category leads to another box with a further choice of tasks or icons for specific control panel applets. The figure below shows the choice when "Performance and Maintenance" is clicked .

A second way of displaying Control Panel is called the "Classical View" and displays icons for individual applets. A partial view is shown below. Some of these applets may have several tabs that open different functions.

Control Panel Applets

Some of the components of the Control Panel are special system folders but many are determined by a group of files with the extension CPL. Most of these files are in the folder\Windows\System32\; some that are part of application software may be elsewhere. To find which CPL files are on your system, go to Windows Search and search for all files with name *.cpl. The table below lists some of the common CPL files. CPL files can be used to directly access various features of Control Panel by opening them with eitherRundll32.exe or Control.exe. By this means, scripts or shortcuts can be written for immediate access to particular functions. Commands using these files can also be entered into the Start-Run line. Note that some CPL files are multi-functional and require additional parameters to invoke the various functions. Parameters use the "@" sign and a zero-based integer. Tabs are denoted by additional indexes (not necessarily zero-based integers). More details are given in the section on shortcuts below.

Table I. Some Control Panel Applet Files
File Function Tabs (number in parentheses is index n discussed below)
access.cpl Accessibility controls Keyboard(1), Sound(2), Display(3), Mouse(4), General(5)
appwiz.cpl Add/Remove Programs
desk.cpl Display properties Themes(5), Desktop(0), Screen Saver(1), Appearance (2), Settings(3)
hdwwiz.cpl Add hardware
inetcpl.cpl Configure Internet Explorer and Internet properties General(0), Security(1), Privacy(2), Content(3), Connections(4), Programs(5), Advanced(6)
intl.cpl Regional settings Regional Options(1), Languages(2), Advanced(3)
joy.cpl Game controllers
main.cpl Mouse properties and settings Buttons(0), Pointers(1), Pointer Options(2), Wheel(3), Hardware(4)
main.cpl,@1 Keyboard properties Speed(0), Hardware (1)
mmsys.cpl Sounds and Audio Volume(0), Sounds(1), Audio(2), Voice(3), Hardware(4)
ncpa.cpl Network properties
nusrmgr.cpl User accounts
powercfg.cpl Power configuration Power Schemes, Advanced, Hibernate, UPS (Tabs not indexed)
sysdm.cpl System properties General(0), Computer Name(1), Hardware(2), Advanced(3), System Restore(4), Automatic Updates(5), Remote (6)
telephon.cpl Phone and modem options Dialing Rules(0), Modems(1), Advanced(2)
timedate.cpl Date and time properties Date & Time(0), Time Zone(1), Internet Time (no index)

Shortcuts and Scripts Using Control.exe

As outlined at the beginning of this page, the standard way to open Control Panel functions by using Start-Control Panel requires several steps. If a particular function is frequently used, it may be convenient to create a shortcut that opens the desired window directly. It is common on the Internet to find shortcuts that use the executable fileRundll32.exe to open CPL files and these are discussed here. However, many of the standard shortcuts are for Windows 98/Me and do not work in Windows XP. Also there are easier, shorter ways available for Control Panel applets. Using Rundll32.exe is a general method applicable to many different types of DLL files with a complicated syntax. For CPL files there is a specific method using the executable Control.exe that I think is preferable. It has the simpler syntax shown below.

control somefile.cpl,<optional arguments>

Here, somefile.cpl stands for whichever of the CPL files is of interest. There are two types of optional arguments. They are of the form "@m,n" (without the quotes.) Here "m" and "n" are integers. Thus, the full expression when optional arguments are included is

control somefile.cpl,@m,n

The parameter @m is used for files with more than one basic function and starts with zero, which is the default value if no parameter is used. For example, main.cpl controls both mouse and keyboard properties. Thus, either the command

control main.cpl
or
control main.cpl,@0

would open the mouse properties. To open the keyboard properties the command would be

control main.cpl,@1

The second set of optional parameters "n" can be used when a dialog box is tabbed. A number of the values are given in Table I. For example, the default window when the mouse properties dialog is opened is the "Buttons" tab. To open the"Pointer Options" tab (third on the list) the command would be

control main.cpl,@0,2

Note that here the index "n" is zero-based so the third tab has an index of 2.

Many control panel files have only one main page and the "@m" index can be omitted. In that case, to open a particular tab requires two commas between the file name and the tab index. For example, the dialog box for System Properties has a number of tabs as listed in the table above. A specific one of these can be opened by adding a parameter so that the command reads

control.exe sysdm.cpl,,n

where "n" is an integer running from 0 to 6 corresponding to the 7 tabs listed in Table I.

Unfortunately, Microsoft is not consistent in how it indexes tabs. For example, when using access.cpl, the tabs run from 1 to 5 instead of beginning with zero. Some files can only be opened at a few tabs or only at the beginning tab. For instance, Power Options has four tabs but they are not accessible with an index. The only way to find out what system applies to a particular file seems to be trial and error. Also note that the numbering of tabs for many files is not the same in Windows XP as it was in Windows 98/Me. Also, at least one change was made in Windows XP SP2. Many of the values are given in the book, Microsoft Windows XP, Inside Out (2d edition), by Bott, Siechert, and Stinson, which has been used as a partial source for Table I above.

Easier Shortcuts Using Control.exe

Trying to open control panel applets with commands containing the complexity of index parameters discussed in the previous section may seem rather daunting to some PC users. Fortunately, there are some alternate commands using plain names that can also be used. These do not seem to be as well-known but are discussed in Microsoft'sMSDN library. Fewer possibilities are available than with the previously discussed methods but there are some new commands as well. Three that work in Start-Run are given below.

Table II. Commands using plain names
Command Function
control date/time Launches the Date and Time Properties window
control desktop Launches the Display Properties window
control color Launches the Display Properties window with the Appearance tab preselected

Scripts using Shell object

Control panel applets can also be opened with JScript or VBScript files using the Shell.Application object and its ControlPanelItem method . For a control panel appletsomefile.cpl the syntax is
Shell.ControlPanelItem("somefile.cpl" )
For example, the display applet desk.cpl would use
Shell.ControlPanelItem("desk.cpl" )
A snippet of the corresponding code for VBScript is
dim objShell
set objShell = CreateObject("Shell.Application")
objShell.ControlPanelItem("desk.cpl")

Other Shortcuts

There are also a number of other quick ways to get to some of the Control Panel components. Here is a short list of some.

  • Using the Windows key + the Break key will open the System Properties dialog box.
  • Enter devmgmt.msc into Start-Run to open Device Manager
  • Enter fonts into Start-Run to open the Fonts folder
  • Enter main.cpl into Start-Run to open Mouse properties
  • Enter desk.cpl into Start-Run to open Display properties
  • Enter control userpasswords2 into Start-Run to manage User Accounts

Note that any file with extension CPL can be used directly as long as your system has the usual file association of CPL with Control.exe. To see how to check your file associations or to change file associations go to this tutorial.

No comments: