locked
Task scheduler on laptop lid close? RRS feed

  • Question

  • Does anyone know if it's possible to schedule a task (e.g., mute sound) when the lid of a laptop computer is closed?

    Thank you.

    • Moved by Carey FrischMVP Monday, November 15, 2010 7:05 AM Moved to appropriate forum category (From:Windows 7 Installation, Setup, and Deployment)
    Monday, November 15, 2010 6:57 AM

Answers

  • Hi,

     

    It would be a bit complicated because there is no direct User Interface to choose “Close lid” action in Task Scheduler.

     

    As a workaround, you can create the task scheduler based on Event Log. Set “what lid close does” to Sleep, then, you can configure the task scheduler as below:

     

    1 Input “Task Scheduler” in search box and press Enter

     

    2 Click “Create task…” on the  Task Scheduler---Action

     

    3 Go to Triggers, create new triggers

     

    4 On “Begin the task”, select “On an event”

     

    5 Select Log to “system” , set “Source” to “Kernel-Power” , Event ID is “42” and click “Ok”

     

    6 Go to “Actions” and create a new actions

     

    7 You can select “Start a program”, “Send an e-mail” and “Display a message” on action as you need. If you want to mute sound, a script may be needed.

     

    You can also create a shortcut about mute sound and run it as program. See below:

     

    http://www.recipester.org/Recipe:Create_a_Shortcut_to_Mute_the_System_Volume_in_Windows_7_38339098

     

    8 Save the task scheduler

     

    9. On conditions tab, check the box “Wake the computer to run this task”. Click OK.

     

    Thus, when you close laptop lid, you PC will go to sleep mode, and sleep mode trigger the task scheduler.

     

    Hope it may help.

     

    Regards,

    Leo   Huang


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Leo Huang Wednesday, November 24, 2010 1:34 AM
    Wednesday, November 17, 2010 7:48 AM

All replies

  • Hi,

     

    It would be a bit complicated because there is no direct User Interface to choose “Close lid” action in Task Scheduler.

     

    As a workaround, you can create the task scheduler based on Event Log. Set “what lid close does” to Sleep, then, you can configure the task scheduler as below:

     

    1 Input “Task Scheduler” in search box and press Enter

     

    2 Click “Create task…” on the  Task Scheduler---Action

     

    3 Go to Triggers, create new triggers

     

    4 On “Begin the task”, select “On an event”

     

    5 Select Log to “system” , set “Source” to “Kernel-Power” , Event ID is “42” and click “Ok”

     

    6 Go to “Actions” and create a new actions

     

    7 You can select “Start a program”, “Send an e-mail” and “Display a message” on action as you need. If you want to mute sound, a script may be needed.

     

    You can also create a shortcut about mute sound and run it as program. See below:

     

    http://www.recipester.org/Recipe:Create_a_Shortcut_to_Mute_the_System_Volume_in_Windows_7_38339098

     

    8 Save the task scheduler

     

    9. On conditions tab, check the box “Wake the computer to run this task”. Click OK.

     

    Thus, when you close laptop lid, you PC will go to sleep mode, and sleep mode trigger the task scheduler.

     

    Hope it may help.

     

    Regards,

    Leo   Huang


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Leo Huang Wednesday, November 24, 2010 1:34 AM
    Wednesday, November 17, 2010 7:48 AM
  • I appreciate your suggestions. However, I'm trying to have the sound be muted without having the computer go to sleep--I've sent the power settings such that it doesn't go to sleep when I close the lid. The idea is to have it remain accessible for RDP, etc., but without the computer making any noise, after I close the lid.

    Thanks.

     

     

    Thursday, November 18, 2010 1:05 AM
  • Hi,

    I’m afraid it hard to realize that because task scheduler have no trigger of “close the lid”.

     

    Thank you for your understanding.

     

    Regards,

    Leo   Huang


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Thursday, November 18, 2010 6:59 AM
  • My laptop does that automatically and it drives me crazy.  I would like to keep it from muting the sound when  close the lid.  There must be some setting that enables and disables this, but it may be a bios function, also, that is not accessible.
    Monday, January 23, 2012 4:18 PM
  • Hi, Leo,

    Pretty good and detailed answer but unfortunately it seems it doesn't work anymore. At least not on Windows 10.

    I'm trying to achieve device locking at lid closing but the trigger doesn't work. When I start the task manually, it locks the PC, which means that the problem is in the trigger.

    Do you have any idea for changes in this event on Windows 10? I see your answer is from 2010, so this might have been changed since then.

    Best,
    Radoslav

    Wednesday, March 1, 2017 7:15 PM