title: How do I enable "Allow this device to wake the computer" programmatically?
body: <p>On some computers, the network adapters are, by default, configured with the "allow this device to wake the computer" option turned off.  As a result, Wake on LAN won't work.</p>
  
  <p>I need to turn this option back on, but I can't do it by hand - too many computers!  So, I need to be able to do it via an API or with a script.</p>
  
  <p>(Note: this is not a duplicate of <a href="https://stackoverflow.com/questions/775006/how-to-enable-wake-on-lan-programmatically">How to Enable Wake On LAN programmatically</a> because that question is about the BIOS setting whereas this one is about the operating system setting.)</p>
  
  <p>I have an answer already using a batch script, but alternative solutions would be very welcome, especially if they use an API.</p>