Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



Windows 7: Sleep mode

24 Jan 2013   #1

Windows 7 32 bit
 
 
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 System SpecsSystem Spec
.

24 Jan 2013   #2

Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
 
 

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 System SpecsSystem Spec
25 Jan 2013   #3

Windows 7 32 bit
 
 

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 System SpecsSystem Spec
.


25 Jan 2013   #4

Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
 
 

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 System SpecsSystem Spec
26 Jan 2013   #5

Windows 7 32 bit
 
 

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 System SpecsSystem Spec
26 Jan 2013   #6

Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
 
 

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.


Attached Files
File Type: bat Sleep.bat (1.3 KB, 11 views)
My System SpecsSystem Spec
26 Jan 2013   #7

Windows 7 32 bit
 
 

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
My System SpecsSystem Spec
26 Jan 2013   #8

Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
 
 

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 System SpecsSystem Spec
26 Jan 2013   #9

Windows 7 32 bit
 
 

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 System SpecsSystem Spec
26 Jan 2013   #10

Windows 7 32 bit
 
 

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 System SpecsSystem Spec
Reply

 Sleep mode





Thread Tools



Similar help and support threads for2: Sleep mode
Thread Forum
Sleep Mode errors - system won't sleep, 12 errors in energy-report Performance & Maintenance
Help Please...PC won't come out of sleep mode unless I... BSOD Help and Support
Sleep mode issues (suspend mode??) BSOD Help and Support
How do i use hibernate mode without going into sleep mode first Software
sleep mode Performance & Maintenance
Can't go into sleep mode Performance & Maintenance
Hdd led and sleep mode. General Discussion

Our Sites

Site Links

About Us

Find 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 05:14 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33