Power Off/Standby - Start batch file (1 Viewer)

chrisonline

MP Donator
  • Premium Supporter
  • August 17, 2007
    515
    37
    44
    Tirol/Wörgl
    Home Country
    Austria Austria
    If I tap "Power off" on my Harmony the HTPC goes into standby.
    Is it possible to start a Windows batch file instead of standby?

    I want to achieve following:
    If I hit "Power Off" on my remote a batch file should send a command to my HUE lights to turn it off and afterwards the batch file sends another command for standby/hibernate.
     
    Last edited:

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    This can be better achieved within Windows: use the Task Scheduler to define actions and link it to triggers for which you select the appropriate entry.
     

    chrisonline

    MP Donator
  • Premium Supporter
  • August 17, 2007
    515
    37
    44
    Tirol/Wörgl
    Home Country
    Austria Austria
    With Windows I think it does not wait until the batch file is finished.
    And how can I set a trigger in the Task Scheduler for "Before Standby"?
     

    chrisonline

    MP Donator
  • Premium Supporter
  • August 17, 2007
    515
    37
    44
    Tirol/Wörgl
    Home Country
    Austria Austria
    I have found the same, but this does not work. It execute the batch file and immediately goes to sleep. So the batch script has no time to execute. After resume it will run.

    Gesendet von meinem Galaxy S7 mit Tapatalk
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    Are you sure that your Bach is getting called? Does the scheduler log the task as successfully executed?
     
    Last edited:

    chrisonline

    MP Donator
  • Premium Supporter
  • August 17, 2007
    515
    37
    44
    Tirol/Wörgl
    Home Country
    Austria Austria
    Yes I am sure. I have made a batch file who send the command to my HUE lights and afterwards "pause". So the command window is still open.
    If I go to sleep it goes immediately to sleep and my lights are still on.
    After resume I see the batch file open and the lights are turning off :-(
    So either it starts the batch file after resume OR before sleep but does not wait until complete.
     

    chrisonline

    MP Donator
  • Premium Supporter
  • August 17, 2007
    515
    37
    44
    Tirol/Wörgl
    Home Country
    Austria Austria
    Yes I have Windows Pro version.
    Thanks for the link didn't know that, but there is only a "signon and signoff" and no "hibernate" "sleep" setting.
    And I don't signoff the user. Anyway I will try it if "signoff" is also triggered when the PC goes to sleep.
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    Have you thought about using something like EventGhost - http://www.eventghost.org/ - to handle the remote commands, it can do pretty much anything you like in response to a command (although the learning curve to set it up can be steep...).
     

    Users who are viewing this thread

    Top Bottom