4

My PC gone sleep and then wake up in about few minutes. After checked with powercfg -lastwake I found this.

Wake History Count - 1
Wake History [0]
  Wake Source Count - 1
  Wake Source [0]
    Type: Wake Timer
    Owner: [PROCESS] \Device\HarddiskVolume2\Program Files (x86)\LINE\LINE.exe
    Owner Supplied Reason: generic

The program LINE.exe (Naver Line) wake up my PC. There is no any setting from LINE to not wake up my PC.
How to prevent only some program to wake up my PC?

  • Possible solution. – Wobbly Feb 2 '16 at 8:35
  • @Wobbly Thanks, but none of that can fixed. It is not about power plan, no Line app in policy, No line app in task scheduler. – vee Feb 2 '16 at 8:40
  • 1
    Terminate the line program before sleeping seems to be the obvious answer. – DavidPostill Feb 2 '16 at 10:41
  • @DavidPostill Yes, I did that. I use quit the Line program before manually go to sleep mode but if computer go to sleep mode automatically the Line program will not terminated. :) – vee Feb 2 '16 at 14:37
2

I think you need to modify the question, because DavidPostill already answered what you need.

Terminate the line program before sleeping seems to be the obvious answer. – DavidPostill Feb 2 at 10:41

@DavidPostill Yes, I did that. I use quit the Line program before manually go to sleep mode but if computer go to sleep mode automatically the Line program will not terminated. :) – vee Feb 2 at 14:37

In theory you can schedule a task right after the sleep event. I am not sure whether it would work, but it's worth a try:

  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.

Some reference is this Microsoft-link.

So you need to schedule a task right after a system / kernel power event. The id of the sleep event is 42. You need a small script, which closes your application, probably something from WSH or a batch script.

If the event 42 is too late for closing the application then there is still hope. According to this there is no before sleep event in the kernel power api: https://superuser.com/a/601685/105936 , but you might find something similar by investigating further the links in the answer.

So it is not impossible to close the application automatically, but you have to work on it.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.