/build/static/layout/Breadcrumb_cap_w.png

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

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


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 - Channeler 5 years ago
  • Hi, you can use the software "caffeine" with this parameters :
    "caffeine.exe -exitafter:720" <- This is keeping wakeup your machine for 24 hours - madro 5 years ago

Answers (3)

Answer Summary:
Posted by: feeldamped 5 years ago
Third Degree Blue Belt
3

Top Answer

Hi,

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. 
Posted by: DaveMT 5 years ago
4th Degree Black Belt
1
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
Posted by: indyram44 5 years ago
Senior White Belt
1
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.
 
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