Note: This article was originally published in 2007. Some steps, commands, or software versions may have changed. Check the current General documentation for the latest information.

Sometimes you have to open or access Control Panel Items via a script or you want to open it for a remote client and it is kind of hard to come up with a command line to address that issue. Microsoft has posted in their MSDN website (http://msdn2.microsoft.com/En-US/library/bb419052.aspx) information regarding how to do this.

Most importantly, if your application wishes to open an item in the Control Panel you use:

WinExec(“c:windowssystem32control.exe MyCpl.cpl”, SW_NORMAL);

And if you simply wish to open something like the Printers and Faxes folder, take a look at this (obtained as is from the website mentioned above):

 

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 desktopLaunches the Display Properties window.
control.exe colorLaunches the Display Properties window with the Appearance tab preselected.
control.exe date/timeLaunches the Date and Time Properties window.
control.exe internationalLaunches the Regional and Language Options window.
control.exe mouseLaunches the Mouse Properties window.
control.exe keyboardLaunches the Keyboard Properties window.
control.exe printersDisplays the Printers and Faxes folder.
control.exe fontsDisplays the Fonts folder.

For Windows 2000 and later systems:

control.exe foldersLaunches the Folder Options window.
control.exe netwareLaunches the Novell NetWare window (if installed).
control.exe telephonyLaunches the Phone and Modem Options window.
control.exe admintoolsDisplays the Administrative Tools folder.
control.exe schedtasksDisplays the Scheduled Tasks folder.
control.exe netconnectionsDisplays the Network Connections folder.
control.exe infraredLaunches the Infrared Monitor window (if installed).
control.exe userpasswordsLaunches the User Accounts window.

 Alternatively you can try something like:

 ::{2227A280-3AEA-1069-A2DE-08002B30309D}

That would open the Printers and Faxes if ran from the Start—>Run Menu. You can probably leverage this and use similar IDs for different things in Windows.