tags:

views:

33

answers:

1

From time to time I need to run a full build of the entire tool chain for our software on my development machine. To save on power my I've got my dev machine set to go sleep after 20 minutes of inactivity. Building the full tool chain can take up to an hour and I'll often just go to lunch. However, if I forget to disable sleep I can return to a sleeping machine with the build only partially complete.

What I'm looking for is a way to automatically disable sleep while MSBuild is running. Does anyone know of a simple way of doing this?

+3  A: 

Add pre-build/post-build events to stop and start the power service respectively perhaps ? Create a power scheme that disables sleeping and then add use the powercfg /setactive switch. For example:

powercfg /setactive YourNewSchemesGUID

GUIDs can be enumerated using the /query switch.

shadeMe
Perhaps you've seen a utility that does this?
Paul Alexander
Edited above answer for clarification.
shadeMe
Brilliant. So simple and elegant - and built in!
Paul Alexander