Systems Deployment Question

How to prevent machine going to sleep during Scripted Install of Windows 10

07/20/2018 1591 views
We have a number of builds but have been having problems with the machines entering sleep mode during the install. This happens on Desktops and Laptops irrespective of whether they are mains powered. I know this is a complete newbie question but I have spent some time looking for an answer and there must be a really simple solution - apart from moving the mouse every so often :)

Many Thanks

Answer Summary:
2 Comments   [ + ] Show comments


  • Windows tends to have sleep settings enabled, especially when using scripted installs.... If the Post Install tasks take a long time, its possible the machine might go to sleep...

    If you could find a way to modify the power settings via Powershell or CMD, you may want to add a post install task to temporary disable sleep....

    Now if you are installing that many Post Install tasks, consider building a Golden Image
  • This content is currently hidden from public view.
    Reason: Removed by member request For more information, visit our FAQ's.
  • Hi, you can use the software "caffeine" with this parameters :
    "caffeine.exe -exitafter:720" <- This is keeping wakeup your machine for 24 hours

Answer Chosen by the Author


The way we overcame this is with a Visual Basic script. It basically identifies the chassis, identifies the current power plan, and then sets the power configuration for no hibernation/no sleep/no standby.

This is one of the first post-install tasks we have. Since near the end we have tasks for joining the domain, the power settings will get set back to something normal from GPO, after the machine is on the domain.


I did a quick Google search and I was able to find some examples of VB scripts for sleep settings/standby settings - try something like that out! It has worked for us with scripted installs for Win7 machines and Win10. 
Answered 07/20/2018 by: feeldamped
Third Degree Blue Belt

All Answers

We also ran into this during scripted installs.  Ours would occur when it was deploying the current KB Cumulative patch.  We added a few lines to a batch file to start the patch that solved this for us as a post install task. You could do this as a stand alone task and deploy it as one of your first Post Install tasks.  Here are the command we use:

powercfg.exe -change -standby-timeout-ac 360
powercfg.exe -change -monitor-timeout-ac 350

These don't disable sleep/standby, but just set it to a 6 hour delay.  If we have an scripted install/image that is taking more than 6 hours, we figure we have a bigger problem.   

I Hope this helps you out
Answered 08/01/2018 by: DaveMT
4th Degree Black Belt

Put these commands into a post install task (or batch file that is already going to run early in the post install list):

powercfg /change -standby-timeout-ac 0
powercfg /change -monitor-timeout-ac 0

This will turn off all the power saving settings. I put them in the batch file I use to install AutoCAD since it's such a large install. I have group policy set to enable power saving so I don't have to worry about resetting these values in my batch file, but you could if you wanted to re-enable power saving.
Answered 08/02/2018 by: indyram44
White Belt

This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ