Solved Sleep mode

senna99

New member
Local time
10:03 PM
Messages
17
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

Computer Manufacturer/Model Number
Intel
OS
Windows 7 32 bit
CPU
G530
Motherboard
MSI
Memory
DDR3 2GB
Graphics Card(s)
HD6570
Sound Card
NO
Monitor(s) Displays
LED 19''
Hard Drives
WD 320GB 2,5''
PSU
300W
Case
HOME MADE
Cooling
NO
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

Computer type
PC/Desktop
OS
Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
Other Info
"The scale icon at the top right of a post or tutorial is how you can give rep to the member."
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

Computer Manufacturer/Model Number
Intel
OS
Windows 7 32 bit
CPU
G530
Motherboard
MSI
Memory
DDR3 2GB
Graphics Card(s)
HD6570
Sound Card
NO
Monitor(s) Displays
LED 19''
Hard Drives
WD 320GB 2,5''
PSU
300W
Case
HOME MADE
Cooling
NO
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

Computer type
PC/Desktop
OS
Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
Other Info
"The scale icon at the top right of a post or tutorial is how you can give rep to the member."
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

Computer Manufacturer/Model Number
Intel
OS
Windows 7 32 bit
CPU
G530
Motherboard
MSI
Memory
DDR3 2GB
Graphics Card(s)
HD6570
Sound Card
NO
Monitor(s) Displays
LED 19''
Hard Drives
WD 320GB 2,5''
PSU
300W
Case
HOME MADE
Cooling
NO
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.
 

Attachments

My Computer

Computer type
PC/Desktop
OS
Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
Other Info
"The scale icon at the top right of a post or tutorial is how you can give rep to the member."
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:

My Computer

Computer Manufacturer/Model Number
Intel
OS
Windows 7 32 bit
CPU
G530
Motherboard
MSI
Memory
DDR3 2GB
Graphics Card(s)
HD6570
Sound Card
NO
Monitor(s) Displays
LED 19''
Hard Drives
WD 320GB 2,5''
PSU
300W
Case
HOME MADE
Cooling
NO
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 [B]program.exe[/B]
Instead program.exe type file name of your program.
 

My Computer

Computer type
PC/Desktop
OS
Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
Other Info
"The scale icon at the top right of a post or tutorial is how you can give rep to the member."
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

Computer Manufacturer/Model Number
Intel
OS
Windows 7 32 bit
CPU
G530
Motherboard
MSI
Memory
DDR3 2GB
Graphics Card(s)
HD6570
Sound Card
NO
Monitor(s) Displays
LED 19''
Hard Drives
WD 320GB 2,5''
PSU
300W
Case
HOME MADE
Cooling
NO
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

Computer Manufacturer/Model Number
Intel
OS
Windows 7 32 bit
CPU
G530
Motherboard
MSI
Memory
DDR3 2GB
Graphics Card(s)
HD6570
Sound Card
NO
Monitor(s) Displays
LED 19''
Hard Drives
WD 320GB 2,5''
PSU
300W
Case
HOME MADE
Cooling
NO
No problem. I have redone it with AutoHotKey scripting language. Now it is a windowless exe program.


If your media center XBMC.exe was started as non-administrator, this script will close it without a problem.

If XBMC.exe was started as administrator, you have to activate start as administrator option for this exe.
Right click Custom_Sleep.exe and Properties - Compatibility - Run as Administrator.
 

My Computer

Computer type
PC/Desktop
OS
Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
Other Info
"The scale icon at the top right of a post or tutorial is how you can give rep to the member."
Thank you very much works perfectly,no longer pops up a window.
I owe you for this help.

Best Regards
 

My Computer

Computer Manufacturer/Model Number
Intel
OS
Windows 7 32 bit
CPU
G530
Motherboard
MSI
Memory
DDR3 2GB
Graphics Card(s)
HD6570
Sound Card
NO
Monitor(s) Displays
LED 19''
Hard Drives
WD 320GB 2,5''
PSU
300W
Case
HOME MADE
Cooling
NO
Why use a script?

I use a simple shortcut that runs this:
C:\WINDOWS\system32\rundll32.exe Powrprof.dll,SetSuspendState Sleep

Simple.
 

My Computer

OS
Win 7
Why use a script?

I use a simple shortcut that runs this:
C:\WINDOWS\system32\rundll32.exe Powrprof.dll,SetSuspendState Sleep

Simple.
Thas is very kind of you, lhorwinkle. Thank you for sharing your knowledge.
But you have not read all the messages in this thread, have you?

Let me sum it up for you. OP requested several things besides sleep:
KILL CERTAIN PROGRAM
and
NO COMMAND LINE/ SCRIPT WINDOW.

I have implemented all of the requests in AutoHotKey script, which I have converted to exe file.
 

My Computer

Computer type
PC/Desktop
OS
Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
Other Info
"The scale icon at the top right of a post or tutorial is how you can give rep to the member."
Hello Neutron16
I have a question I use the plugin in XBMC.Advance launcher which loads the lnk file and exe file.
When I start the exe file cmd do not pops up, when I start lnk file cmd is pops up.I've tried all the advice from the Internet,but not worth anything.I ask you for advice how to cmd not pops up.lnk files is for yahoo internet, xbox live, etc.
I use Maxton brovser over it create lnk file.
When I start lnk I get a clean page without borders this is the reason why I need the lnk file.Forgive me if I'm boring.
Best Regards
 
Last edited:

My Computer

Computer Manufacturer/Model Number
Intel
OS
Windows 7 32 bit
CPU
G530
Motherboard
MSI
Memory
DDR3 2GB
Graphics Card(s)
HD6570
Sound Card
NO
Monitor(s) Displays
LED 19''
Hard Drives
WD 320GB 2,5''
PSU
300W
Case
HOME MADE
Cooling
NO
Hello Neutron16
When I start the exe file cmd do not pops up, when I start lnk file cmd is pops up.
I am sorry, I am not clear with what you have said. Normally, when you start a lnk file there is no cmd.
Could you be so kind to write me a private message with more detailed explanation with the file itself and couple screenshots?
 

My Computer

Computer type
PC/Desktop
OS
Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
Other Info
"The scale icon at the top right of a post or tutorial is how you can give rep to the member."
Yes of course I will send you a private message.Thanks to the rapid response and interest for my problem.
Best Regards
 

My Computer

Computer Manufacturer/Model Number
Intel
OS
Windows 7 32 bit
CPU
G530
Motherboard
MSI
Memory
DDR3 2GB
Graphics Card(s)
HD6570
Sound Card
NO
Monitor(s) Displays
LED 19''
Hard Drives
WD 320GB 2,5''
PSU
300W
Case
HOME MADE
Cooling
NO
Back
Top