How to run a command on wakeup from hibernation (1 Viewer)

kiwijunglist

Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    there are a few options.

    MCE MST Standby Tool
    MPStandby Handler
    LMremote - LM Gestion : LM Remote KeyMap : React upon computer events (launch application at shutdown, turn off tv when standing by...)

    The thing that interests me with LM remote is this...

    PC Resume Sleeping : this events occurs when your PC return to stand by from a wake up state that was provoked by a scheduled task or some other events but was never fully resumed (meaning you have not used the PC since he wake up). When this event occurs it replace the "PC Standing By" event.

    PC Resuming Auto : this event occurs when your PC is resuming from stand by automatically to handle an event (scheduling task for instance). This event also happens when you are resuming your PC to interact with it.

    PC Shutting down : this event occurs when you are shutting down / restarting your PC

    PC Standing By : this event occurs when your PC is going into stand by. If your computer is going to stand by but was never fully resumed before going to stand by (meaning the PC was on because of a scheduled task and not because you waked him up manually), the "PC Resume Sleeping" is fired instead.

    PC Waking Up : this event occurs when your are resuming your PC from stand by. This event doesn't happen when your PC is resuming itself to handle an event
     

    mameo

    MP Donator
  • Premium Supporter
  • August 8, 2006
    74
    0
    Perugia
    Home Country
    Italy Italy
    PowerScheduler will call you command both on suspend and on wake up.
    Assuming the command you configure is "c:\example.bat", on suspend it will call:
    Code:
    c:\example.bat suspend
    and on wake up it will call:
    Code:
    c:\example.bat wakeup
    So your batch file should check %1 to see if it is called as a result of a suspend or a wake up, and act accordingly. Something like this:
    Code:
    if "%1" == "suspend" goto OnSuspend
    if "%1" == "wakeup" goto OnWakeUp
    goto Done
    
    :OnSuspend
    ... do your suspend stuff ...
    goto Done
    
    :OnWakeUp
    ... do your wake up stuff ...
    goto Done
    
    ...
    
    :Done

    I tried to use "stay on" option in power scheduler to complete power off my pc (I want to shutdown my computer instead of hibernation or standby) but I don't understand how to use in batch file the "stay on" option. Someone can explain me? Is there another way to complete shutoff pc instead standby or hibernation by using power scheduler?
     

    Users who are viewing this thread

    Top Bottom