Set Windows power states from the command line Use powercfg to set Windows power states from a script or command line. If you're new here, you may want to subscribe to my RSS feed or learn more about me, Ben Hamilton or link to me via LinkedIn. I can be found tweeting at @benhamilton. Thanks for visiting!