Help the computer automatically change the sleep state

jilian sheng 0 Reputation points
2024-08-22T03:36:40.16+00:00

Such as:1. AM 9:00 ~ PM 18:00 The system is a sleep state

            2. PM 18:00~PM 21:30  Change to Running state (Sleep not allowed)

Every day to change sleep Settings is Key point and Mainly the method of implementing the second item

Thank you

Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jing Zhou 7,765 Reputation points Microsoft External Staff
    2024-08-27T07:43:57.2866667+00:00

    Hello,

     

    Thank you for posting in Q&A forum.

    To achieve automatic switching of the computer to different sleep states at specific times, you can set Windows' scheduled tasks. Here are some step-by-step guidelines:

    1: Set automatic sleep mode

    Press Win+R to open the run window, enter taskschd.MSC, and then press Enter to open the task scheduler.

    In the left panel of the Task Scheduler, right-click on "Task Scheduler Library" and select "Create Basic Task".

    Enter the task name (such as "Automatically enter sleep mode") and click "Next".

    Select 'Daily' and click 'Next'.

    In the "Start" box, set the date and time for the first startup to 9:00 am, select "Repeat daily", and then click "Next".

    In the "Operation" option, select "Start Program", and then click "Next".

    In the "Program or Script" box, enter powercfg, and in the "Add Parameters" box, enter - h off (disable sleep mode) to ensure that the computer does not enter sleep mode in the morning.

    Click 'Next', then click 'Finish'.

    Repeat the above steps and create another task, setting the time to enter sleep mode as required. In the "Operation" option, change the parameter to - change - steady by timeout ac 600 (this parameter can be adjusted to the corresponding number of minutes as needed, indicating that the system enters sleep mode after idle time).

    2: Set automatic departure from sleep mode

    Similarly, in the Task Scheduler, right-click on "Task Scheduler Library" and select "Create Basic Task".

    Enter the task name (such as "Automatically exit sleep mode") and click "Next".

    Select 'Daily' and click 'Next'.

    In the 'Start' box, set the first startup time to PM 6:00, select 'Repeat daily', and then click 'Next'.

    In the "Operation" option, select "Start Program", and then click "Next".

    In the "Program or Script" box, enter powercfg, and then in the "Add Parameters" box, enter - change - stage by timeout ac 0 (this will remove any restrictions on entering sleep mode).

    Click 'Next', then click 'Finish'.

     

    Ensure that the power options are set to allow the computer to automatically enter sleep mode during peak and off peak periods according to system requirements. For example, you can enter "Power Options" through the control panel to set the appropriate power plan.

    After the setup is complete, you can test these scheduled tasks to ensure they are executed smoothly at the set time.

    When executing certain commands, you may need to run the task scheduler as an administrator to ensure that you have sufficient permissions to execute the settings.

     

    I hope the information above is helpful.

    If you have any questions or concerns, please feel free to let us know.

     

    Best regards,

    Jill Zhou

     


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.