Welcome Guest.   Make a donation to an author on the site November 22, 2014, 04:21:45 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
View the new Member Awards and Badges page.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: [REQ] Disable sleep/hibernation one time to drain battery  (Read 4021 times)
vevola
Charter Member
***
Posts: 88


VeVoLa

View Profile Give some DonationCredits to this forum member
« on: January 05, 2012, 06:31:15 PM »

rather than having to manually change the settings, is there a little app that will temporarily disable sleep/hibernation so as to drain all the battery?
Logged
4wd
Supporting Member
**
Posts: 3,433



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: January 05, 2012, 10:02:37 PM »

Attached is a small program called PowerMaxTemp, (or PMT for short), that will change the current power scheme to either Always On on XP, (and possibly 2003), or High performance for Vista/7.

Normally both these schemes don't allow Standby/Hibernation, however if you've modified them then you'll just have to change them back now smiley
(HINT: If you have changed them, make a copy and call them something else.)

Before changing the power scheme it will determine the current power scheme and then write a command into the RunOnce registry keys, [HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce], to change it back to the current scheme on the next (re)boot.

If you go into the registry editor after running it and look at the entry above you'll see a key similar to the following:

XP:          PMT           powercfg.exe /setactive "Minimal Power Management"
Vista/7:   PMT           powercfg.exe /setactive 381b4222-f694-41f0-9685-ff5bb260df2e

You can delete this key if you don't want it to execute on next boot.

The program will run from CLI or Desktop, there's a bit of error checking to see if powercfg.exe ran OK, it doesn't have any output, (unless there's an error), which I might add later.

It has been tested on my Win7HPx64 Desktop and XP Pro netbook and amazingly it worked.

Have fun.


Updated:
20120112 - Running it a second time reverts to the original power scheme and clears the RunOnce\pmt key.
20120120 - Outputs results into a window.

* PMT.zip (368.8 KB - downloaded 67 times.)
« Last Edit: January 19, 2012, 11:28:50 PM by 4wd » Logged

I do not need to control my anger ... people just need to stop pissing me off!
4wd
Supporting Member
**
Posts: 3,433



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: January 12, 2012, 02:00:52 AM »

Updated, see above - now reverts system on second run.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
vevola
Charter Member
***
Posts: 88


VeVoLa

View Profile Give some DonationCredits to this forum member
« Reply #3 on: January 12, 2012, 05:02:05 AM »

Just curious as to whether I should be "seeing" something (some type of visual feedback), because I don't...  embarassed
Logged
Ath
Supporting Member
**
Posts: 2,262



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: January 12, 2012, 05:15:43 AM »

Just curious as to whether I should be "seeing" something (some type of visual feedback), because I don't...  embarassed

it doesn't have any output, (unless there's an error)

Sounds like all is good Grin
Logged

vevola
Charter Member
***
Posts: 88


VeVoLa

View Profile Give some DonationCredits to this forum member
« Reply #5 on: January 12, 2012, 05:50:06 AM »

cool! thanks!!
Logged
4wd
Supporting Member
**
Posts: 3,433



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: January 12, 2012, 09:25:35 PM »

No visual output.....I'm a bit of a lazy coder cheesy

However, you should get aural feedback.  When my machines are switched to High performance/Always On the CPU fan goes into high gear Wink

I'll look at providing some kind of output window at the end.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
4wd
Supporting Member
**
Posts: 3,433



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: January 19, 2012, 11:32:41 PM »

Updated - now outputs to a window.

Run it once:


Run it again:


It will say Fail instead of Done if the powercfg.exe command failed, (and give the error), or the RunOnce registry entry couldn't be (re)set.

Unfortunately, it's not easy to determine how an AutoIt executable was launched, (CLI or Windows), so the output will always be to a window even if launched from the CLI.

I think that about covers it unless there's a problem - I might look at enabling/disabling Hibernate/Sleep from within the script, (to reduce reliance on powercfg.exe), but don't count on it.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
skwire
Global Moderator
*****
Posts: 4,158



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #8 on: January 20, 2012, 12:38:10 PM »

Nice work, 4wd.  Thmbsup vevola, please confirm this works for you and I'll mark and move this thread to Finished Programs. 
Logged

vevola
Charter Member
***
Posts: 88


VeVoLa

View Profile Give some DonationCredits to this forum member
« Reply #9 on: February 18, 2012, 09:13:39 AM »

Well, it seems to first hibernate, and then on wake up it works...

Also... should I be running it *twice*? I'm not sure I understand your earlier post with the two screenshots...
Logged
4wd
Supporting Member
**
Posts: 3,433



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: February 19, 2012, 03:20:47 AM »

Well, it seems to first hibernate, and then on wake up it works...

What OS are you using?
What is the Power Scheme before you run it, (Control Panel->Power Options) ?
What is the Power Scheme after you run it ?

Always On or High Performance does not normally allow Sleep, Standby or Hibernate unless the Power Scheme has been changed by the user, (you should make a copy and change that instead).

Also... should I be running it *twice*? I'm not sure I understand your earlier post with the two screenshots...

Updated:
20120112 - Running it a second time reverts to the original power scheme and clears the RunOnce\pmt key.
20120120 - Outputs results into a window.

That's what the Revert in the output window signifies, Revert=Yes means it's being run for the second time and is setting the Power Scheme to it's original setting prior to the first time PMT was run, it also clears the RunOnce registry entry.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
vevola
Charter Member
***
Posts: 88


VeVoLa

View Profile Give some DonationCredits to this forum member
« Reply #11 on: March 14, 2012, 03:41:16 PM »

I'm running Win7 64x with "Balanced" power scheme.

To be honest, I tried using the revert, but now hibernation doesn't work at all. When it goes to sleep, I can't wake it up anymore. I see "resuming", and then a black screen and I have to force shut it down. I then see "delete restoration data" or "resume", and I have to "delete" for windows to boot. Which also means that if I forget to save whatever I have open and go away for a while... well... I loose everything.

Any tips?
Logged
4wd
Supporting Member
**
Posts: 3,433



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #12 on: March 14, 2012, 07:41:11 PM »

OK, I'm going to need some more information:

Is your operating system on an SSD or HDD?

The output of the powercfg list command, (see below):

Quote
C:\>powercfg list

Existing Power Schemes (* Active)
-----------------------------------
Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e  (Balanced) *
Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c  (High performance)
Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a  (Power saver)
Power Scheme GUID: e12bd28e-68a8-4f90-b0a5-f76b2b523ca3  (AMD Fusion Utility Recovery Profile)

Can you do a screengrab of PMTs output window when you run it both the first and second time, (like I did here), and either PM them to me or attach to a post.

Can you do a screengrab of both the Balanced and High Performance Advanced settings of your Power Options, the default for both of them should look like this:



Also, after running it once what is the value of the PMT key stored under HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce (use regedit.exe) ?

What is it after running PMT a second time, (it shouldn't be there) ?
Logged

I do not need to control my anger ... people just need to stop pissing me off!
vevola
Charter Member
***
Posts: 88


VeVoLa

View Profile Give some DonationCredits to this forum member
« Reply #13 on: March 15, 2012, 04:45:48 AM »

Quote
Is your operating system on an SSD or HDD?
SSD

Quote
The output of the powercfg list command
Microsoft Windows [Version 6.1.7601]
Existing Power Schemes (* Active)
-----------------------------------
Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e  (Balanced)
Power Scheme GUID: 49ef8fc0-bb7f-488e-b6a0-f1fc77ec649b  (Dell)
Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c  (High performance)
Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a  (Power saver) *

Quote
Can you do a screengrab of PMTs output window when you run it both the first and second time

Can you do a screengrab of both the Balanced and High Performance Advanced settings of your Power Options

Here's an archive with those screengrabs: http://dl.dropbox.com/u/7...36846/pmt_screenshots.rar


Quote
Also, after running it once what is the value of the PMT key stored under HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce (use regedit.exe) ?

powercfg.exe /setactive a1841308-3541-4fab-bc81-f71556f20b4a

Quote
What is it after running PMT a second time, (it shouldn't be there) ?

And it's not.

Thanks for your help!
Logged
4wd
Supporting Member
**
Posts: 3,433



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #14 on: March 15, 2012, 07:42:31 AM »

Thanks, it shows that PMT is, (or trying to), switch from Power Saver to High Performance.

You didn't include the High Performance Advanced settings screengrab, could you please?

I'm running Win7 64x with "Balanced" power scheme.

The powercfg output shows you're running in the Power Saver scheme which is a bit more frugal than the Balanced scheme.

It also seems to indicate that there might be some form of power software installed by Dell, (only because I see a Dell power scheme there - AMD do the same thing if you run their Fusion software IIRC).

Quote
Thanks for your help!

No problem, it's just got me beat how it can be messing up your hibernation when all it does is swap power schemes, it doesn't change anything in those schemes.  It shouldn't even be going into Sleep/Hibernation when in High Performance, as you can see from my grab above, they're both set to Never by default.

You can also reset the power schemes to their default values by pressing the Restore Plan Defaults button under each schemes Advanced settings.

I've attached a small video of what happens when it runs - you can watch it change the power scheme each time it's run, (.7z because you can't attach .mp4 for some reason).

It's the equivalent of you typing in the following commands in a CLI, just as a matter of interest can you effect the same change from the CLI and does it do the same thing Hibernate-wise ?

powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c   (should set to High Performance)
powercfg /setactive a1841308-3541-4fab-bc81-f71556f20b4a    (should set back to Power Saver)

Anyone else care to try it with a Win7 laptop and see what happens?

* PMT.7z (444.44 KB - downloaded 89 times.)
Logged

I do not need to control my anger ... people just need to stop pissing me off!
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.214s | Server load: 0.03 ]