How can I change the default sleep timeout from command line?


  1. Posts : 4,158
    Windows 11 Pro, 22H2
       #1

    How can I change the default sleep timeout from command line?


    When I configure a Virtual Machine, I run a script that I have created that sets all sorts of settings within Windows to my personal preferences.

    By default, Windows configures itself to go to sleep after 30 minutes of inactivity. I like to disable this by setting the timeout to zero. Is anyone familiar with a way of doing this from the command line or through a registry setting? The goal here is for me to be able to add this to my script.
      My Computers


  2. Posts : 43,064
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2

    PowerCfg - Windows CMD - SS64.com

    - looks like
    /Change settingvalue
    /x setting value
    Modify one of the following settings in the current power scheme:
    monitor-timeout-ac minutes
    monitor-timeout-dc minutes
    disk-timeout-ac minutes
    disk-timeout-dc minutes
    standby-timeout-ac minutes
    standby-timeout-dc minutes

    hibernate-timeout-ac minutes
    hibernate-timeout-dc minutes
    Setting any value to 0 will set the timeout=Never
    AC settings are used when the system is on AC power. DC settings on battery power.

    (Not tried it)
      My Computers


  3. Posts : 4,158
    Windows 11 Pro, 22H2
    Thread Starter
       #3

    Thanks, much appreciated.
      My Computers


  4. Posts : 43,064
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #4

      My Computers


  5. Posts : 69,092
    64-bit Windows 11 Pro for Workstations
       #5
      My Computers


  6. Posts : 43,064
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #6

      My Computers


  7. Posts : 4,158
    Windows 11 Pro, 22H2
    Thread Starter
       #7

    Thanks for the tutorial, Brink.
      My Computers


  8. Posts : 69,092
    64-bit Windows 11 Pro for Workstations
       #8

    hsehestedt said:
    Thanks for the tutorial, Brink.
    You're most welcome.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 04:11.
Find Us




Windows 10 Forums