0

Is there a way to make Windows 7 sleep/hibernate no matter if a media player is playing music/movies or not?

I'm asking because I've had times when I'm listening to music while I'm on the PC and when I need to go out I forget to turn the music off and my PC stays turned on until I get back (several hours or more).

EDIT: I know that using the button always works. But I'm talking about leaving it an it going to sleep automatically after a few minutes.

2
  • in this case the music program prevents sleep. Which tool do you use? Dec 21, 2013 at 17:46
  • Edited my question.
    – Bonnev
    Dec 21, 2013 at 20:07

1 Answer 1

0
shutdown -h -f -t 0

Should do the trick. You can put this in a .bat file and then double-click it to execute. You can set the -t flag to the amount of seconds you want it to wait before executing.

4
  • Look at the edit, I'm talking about an automatic sleep/hibernate.
    – Bonnev
    Dec 21, 2013 at 20:05
  • What do you want the trigger for hibernating to be? You clicking something, or something that senses you being away?
    – KJdev
    Dec 21, 2013 at 23:34
  • The mouse not moving for a given amount of minutes. To do what Windows usually does .. just to do it regardless of anything: you're watching a movie but you haven't touched the mouse for 3 minutes so the computer goes to sleep. That's what I want.
    – Bonnev
    Dec 21, 2013 at 23:48
  • You could use Windows Task Sheduler, and use the "On Idle" trigger, but the problem is that if whatever you're using to play music sets the ES_DISPLAY_REQUIRED flag (check msdn on this), this prevents the pc from going to idle. I've googled a little, and haven't found a solution to this.<br> Only thing I can think of is for example connect your smartphone to your pc and have a program hibernate on out-of-range. Or run a webserver in your home-network, and use your smartphone to access it and hibernate the pc.
    – KJdev
    Dec 22, 2013 at 0:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .