Using Task Scheduler to restart a program upon wake from sleep


  1. Posts : 325
    windows 7 Pro 64 Bit
       #1

    Using Task Scheduler to restart a program upon wake from sleep


    I'm using Logitech's latest LGS for my G700. It's very annoying that I have to exit and restart LGS when my system comes out of sleep or LGS doesn't recognize the mouse as being awake (windows drives it then). This happens when the mouse is running wirelessly. It also happens across versions.

    Is there a way to create a task in TS that will exit and restart LSG upon the wake event before or at logon?

    Thanks,
    Salt
      My Computer


  2. Posts : 6,330
    Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
       #2

    Here is a trigger (Custom Event Filter) for a scheduled task I have that might help you.
    It runs when the PC wakes from sleep or resumes from hibernate.
    Here is the source text for the Event Filter XML
    Code:
    <QueryList>
      <Query Id="0" Path="System">
        <Select Path="System">*[System[Provider[@Name='Microsoft-Windows-Power-Troubleshooter'] and (Level=4 or Level=0) and (EventID=1)]]</Select>
      </Query>
    </QueryList>
    Using Task Scheduler to restart a program upon wake from sleep-sttsp01.png

    You would need to add actions to:
    1) kill the task for the running program
    2) start the program

    Hope this helps,
    David
      My Computer


  3. Posts : 325
    windows 7 Pro 64 Bit
    Thread Starter
       #3

    Hi David. Apologies for somehow missing this. Thanks for your response. I haven't had the chance to give this a try yet, but will, and will post back when I do (given how busy I am these days, it may be awhile .

    Thanks again,
    Salt
      My Computer


  4. Posts : 6,330
    Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
       #4

    No problem, work on it whenever you have the time.
    fwiw, I've been using this trigger for years, and it works reliably and never caused any problems for me.
    :)
      My Computer


 

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

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