Open the device manager dialogue using csharp or xaml

geomeo123

New member
Joined
Apr 22, 2025
Messages
4
Programming Experience
1-3
As the title suggests is there an easy way to do this? The only ways I've found supposed to work with powershell and do not work. Here is one way I've tried, but it needs elevation. And I'm not sure how to do that......

C#:
var process = new Process
{
    StartInfo = new ProcessStartInfo("mmc.exe") { Verb = "runas", WindowStyle = ProcessWindowStyle.Hidden }

};
process.StartInfo.Arguments = "devmgmt.msc";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.CreateNoWindow = true;

process.Start();

I'm currently using serial port devices which plug into the PC that Windows assigns a communications port number to. Ie com1, com2 com3 etc. Rather than ask the user to type in device manager at the search box in Windows I'm trying to put in a button so that it's one click away from my port select comboboxes.
 
What error are you getting?
 
Back
Top Bottom