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
senna99

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
Neutron16

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
senna99

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
Neutron16

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
senna99

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
Neutron16

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
senna99

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
Neutron16

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
senna99

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
senna99

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
Thread Forum
Laptop freezes between entering sleep mode to being in sleep mode
Hi, I've had this problem intermittently on my laptop for the past 2 years however it has been occuring more often recently. Basically sometimes when I click the sleep button on Windows 7, the screen fades to black as usual. However the fan keeps running (sounds like when it's on full load) and...
General Discussion
Sleep Mode errors - system won't sleep, 12 errors in energy-report
Issue at large: Win7-64 won't go into sleep mode. Recent issue in last week. Also seems to be automatically resetting from Balanced power mode to High Performance? Below is the energy-report.html results, if they're helpful: Power Efficiency Diagnostics Report Computer Name HOME-PC Scan...
Performance & Maintenance
Help Please...PC won't come out of sleep mode unless I...
power off and unseat the video card, re-seat it, and power back up... win7 pro Intel Core i7 870 Processor ATI FirePro V4800 Motherboard GA-P55A-UD3Without doing the above steps, just get black video screen Would this be a software issue, problem with motherboard or video card?
BSOD Help and Support
How do i use hibernate mode without going into sleep mode first
I want windows media center computer to go into hibernate mode only. Now it goes to sleep after 25 min and then hibernates after 30 min. How do i set it so it will go right into hibernate mode? thanks:)
Software
Sleep Mode
I cannot always get my computer to wake up by hitting a keyboard button. I will have to reboot is. Do I need to program in something? (Not to mention CTRL/ALT/DEL will not reboot my computer so I have to shut off and turn on again.) Also, whenever my computer is off and I turn on again half the...
General Discussion
sleep mode + ics
is there a way i can put my laptop to sleep mode but still resume internet connection sharing? thanks.
Network & Sharing

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 11:43.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App