How to open "Network Connections" window programmatically using C# in Win7, XP??
Asked
Active
Viewed 6,075 times
2 Answers
11
Start a new process using shell execute, and run NCPA.cpl. Like so:
ProcessStartInfo startInfo = new ProcessStartInfo("NCPA.cpl");
startInfo.UseShellExecute = true;
Process.Start(startInfo);
As an extra reference, wikipedia has a pretty comprehensive list of the applets available to you that you can start in this way: http://en.wikipedia.org/wiki/List_of_Control_Panel_applets.
Edit: As a small addition, it may be more sensible to invoke the required control panel applet using the string "control appletname". This is because while most applets can be started with their .cpl name alone, some of them, such as the Administrative Tools, don't have a .cpl name, so you need to use "control admintools" instead.
Edit 2: As an additional reference, check out this knowledge base article: http://support.microsoft.com/kb/192806.

Alistair Evans
- 36,057
- 7
- 42
- 54
-
1+1, a few seconds before I was ready to submit a similar answer :-) – devstuff Feb 17 '11 at 18:01
-
are there any reference for things can be used after "control" command?? – Saw Feb 17 '11 at 18:33
-
1Try the link I just added, but I'm not sure you're going to find a more comprehensive list than the wikipedia one. – Alistair Evans Feb 17 '11 at 18:36
-
Is direct opening of properties from the connected network possible? – Mr. Benbenbenbenben Oct 22 '18 at 03:49
2
Another alternative:
[...]
System.Diagnostics.Process.Start("NCPA.cpl");
[...]