Derek W
Derek W

Reputation: 10026

Is there a way to programmatically create a custom Power Plan in .NET?

So I had an idea, but maybe this is impossible to do. Is there a way within the .NET framework to programmatically create and assign a custom power plan on a Windows machine (preferably in C#).

At work we always have to set the power plan settings by hand for a new machine. It would be nice if this was automated when the machine was being set up. As you might imagine, doing this for hundreds of machines is a bit tedious.

So is this possible? If this is impossible, then is there a clever way around this?

I'm thinking that WMI might be a good place to look for this functionality.

Thanks for your time!

Upvotes: 0

Views: 997

Answers (1)

Allan Elder
Allan Elder

Reputation: 4094

Look at the Windows API Code Pack, which is a wrapper around many of the Windows API

http://archive.msdn.microsoft.com/WindowsAPICodePack

You'll be able to access the Power Management APIs

http://msdn.microsoft.com/en-us/library/aa373163%28VS.85%29.aspx

Upvotes: 1

Related Questions