Sleep mode

Page 1 of 2 12 LastLast

  1. Posts : 17
    Windows 7 32 bit
       #1

    Sleep mode


    I use sleep mode on my pc. How to close running program automatic, when I start sleep mod, like hibernate mod.I use shortcut for sleep mod.
    Best regards
      My Computer


  2. Posts : 934
    Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
       #2

    So, you are using a shortcut to put your system in a sleep mode.
    And you want a running program to be closed just before your system will get into a sleep mode?

    Well, if you do not care about unsaved data (or if your program saves data automatically) I can write a cmd script for you, which upon its start will kill a particular PREDEFINED exe program or several programs running and after that it will put your system into a sleep or hibernation mod. Let me know if it will work for you.
      My Computer


  3. Posts : 17
    Windows 7 32 bit
    Thread Starter
       #3

    That will be nice,I not need to save my data before put pc to sleep mod.
    I just use xbmc media center please write a script, thank you on your response.
    Best regards
      My Computer


  4. Posts : 934
    Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
       #4

    What shortcut are you using for sleep? May be this one?

    And to double check -you want is sleep-sleep, not hibernate?
    Also, is XBMC.exe a main file for xbmc media center?
      My Computer


  5. Posts : 17
    Windows 7 32 bit
    Thread Starter
       #5

    My shortcut have some line from C/windows/system32 I have sleep mode not hibernate XBMC is exe file in xbmc directory
    or if I press alt+f4 I got window for shatdown I set for sleep mod
    Best regards
      My Computer


  6. Posts : 934
    Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
       #6

    Here is the script. However, it will pop up a UAC in the process, because taskkill command works only from an elevated prompt.

    If you need a one click version of a script (without UAC prompt) you would have to install a small utility and I can rewrite a script for you. Let me know.
    Sleep mode Attached Files
      My Computer


  7. Posts : 17
    Windows 7 32 bit
    Thread Starter
       #7

    Hello Neutron16
    I don't know how to thank you ,thank you a thousand times.
    I do not want to look like an ungrateful,can you send my script with one click (without UAC prompt).
    If is that trouble for you in that case ok.I am grateful for this script works perfectly.Thanks again
    Best regards
    Last edited by senna99; 26 Jan 2013 at 05:26. Reason: wrong spell
      My Computer


  8. Posts : 934
    Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
       #8

    You are welcome.
    It is not a trouble for me, rather potential threat/trouble for you. Creating a script that will do the job without UAC prompt would require storing your password openly in a text file.
    That is a major disadvantage. Because a virus or a trojan could potentially find it and cause more harm. Also, it will require installation of some 3rd party software.

    By the way, if you ever want to modify existing script, you can edit it in Notepad.
    To make it kill more programs, add another line at the end
    Code:
    TASKKILL /F /IM program.exe
    Instead program.exe type file name of your program.
      My Computer


  9. Posts : 17
    Windows 7 32 bit
    Thread Starter
       #9

    I understand what you say. Do you have a solution for cmd window to run minimized
    annoys me black window visually. I've tried everything from the Internet. It still pops up a black window.
    thank you once again for the script
    Best regards
      My Computer


  10. Posts : 17
    Windows 7 32 bit
    Thread Starter
       #10

    I not have pop up a UAC only cmd window. I just want to hide cmd window if possible.
    I use windows 7 lite
    Best regards
      My Computer


 
Page 1 of 2 12 LastLast

  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 11:14.
Find Us