tags:

views:

617

answers:

2

Is there a way to open My Computer Properties from C# Windows Application?

For example, user click on a button "Computer Name" and it launches My Computer Properties - "Computer Name" Tab.

+6  A: 

Process.Start("sysdm.cpl");

Michael Bray
Wow, sweet. It even works if you do Start, Run and type in sysdm.cpl
Robert Harvey
I missed the user wanting to open "Computer Name".... to do this, use Process.Start("control.exe", "sysdm.cpl,,1");
Michael Bray
System.Diagnostics
Michael Bray
This is great! Thanks. Can you please tell us the syntax of the second parameter where you put "sysdm.cpl,,1"?
natch3z
That is just the parameters to 'control.exe' (the first parameter to Process.Start is the program to run). You can achieve the same thing by typing "control sysadm.cpl,,1" from Start/Run or from a command prompt as Robert says.
Michael Bray
...And if you mean the specific format of how I knew to use that particular paramters, check out the web page in my previous comments.
Michael Bray
+5  A: 

Now that we know how to do that, here's a link to all of the other Control Panel files:

http://support.microsoft.com/kb/149648

File name      Purpose
-----------------------------------------------------------------------
Access.cpl     Accessibility properties
Appwiz.cpl     Add/Remove Programs properties
Desk.cpl       Display properties
FindFast.cpl   FindFast (included with Microsoft Office for Windows 95)
Inetcpl.cpl    Internet properties
Intl.cpl       Regional Settings properties
Joy.cpl        Joystick properties
Main.cpl       Mouse, Fonts, Keyboard, and Printers properties
Mlcfg32.cpl    Microsoft Exchange or Windows Messaging properties
Mmsys.cpl      Multimedia properties
Modem.cpl      Modem properties
Netcpl.cpl     Network properties
Odbccp32.cpl   Data Sources (32-bit ODBC, included w/ Microsoft Office)
Password.cpl   Password properties
Sticpl.cpl     Scanners and Cameras properties
Sysdm.cpl      System properties and Add New Hardware wizard
Themes.cpl     Desktop Themes 
TimeDate.cpl   Date/Time properties
Wgpocpl.cpl    Microsoft Mail Post Office
Robert Harvey
Here's the page that I keep handy: http://vlaurie.com/computers2/Articles/control.htm
Michael Bray
Thanks, Michael.
Robert Harvey