Pickled Egg
Pickled Egg

Reputation: 123

C# Devcon functionality without Devcon?

I have an app which is using DEVCON to do the following;

How can I do the same without using DEVCON at all? I still need the same functionality listed above.

I have looked into This question and answer but I need to tailor it more towards the criteria above. It also needs to work on x86, x64 and XP+.

Can anyone help with this?

Upvotes: 2

Views: 2625

Answers (1)

Vikas Gupta
Vikas Gupta

Reputation: 4465

To do it from C#, you'd have to pinvoke Windows Setup APIs

This link has an example in C of how the Setup APIs can be used to enumerate devices.

And interestingly enough, there is a Powershell module available on TechNet for Device Management.

If the license allows it, you could take a peek at the implementation, which is in .Net.

Upvotes: 1

Related Questions