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

(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.
Source code in AutoIt
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=klaptopdaemon.ico
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;PowerMaxTemp
#include <Array.au3>
#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include "_Startup.au3"
#include "_OsVersionInfo.au3"
Global $schemes, $MaxPowSch, $CurrPowSch, $Progress
If _OsVersionTest
($VER_GREATER_EQUAL, 6, 0) Then $Progress = 'Vista/7 ' & StringLower(@CPUArch) & ' or higher' $Progress = $Progress & @CRLF
_RevertOldSch()
_GetAllScheme()
_GetMaxPower()
_GetCurrentScheme()
_ResetPowerScheme()
_SetPowerScheme()
_Exit()
; Get me outta here!
MsgBox(64, 'PowerMaxTemp', $Progress)
; Get all power schemes using powercfg.exe /list
MsgBox(48, 'PowerMaxTemp error', 'Failed to run powercfg.exe /list') $PowSchList = ''
$error = ''
$Progress = $Progress & 'Power schemes not read' & ' - Code: ' & @error & @CRLF & 'Exiting...' _Exit()
; Get the Maximum power scheme:
; XP: Always On
; Vista/7: High performance
For $i = 1 To $schemes[0] If _OsVersionTest
($VER_GREATER_EQUAL, 6, 0) Then $Progress = $Progress & 'New scheme: ' & $MaxPowSch & @CRLF
; Get the current power scheme, in Vista/7 it's marked in the list with '*'.
; In XP we have to issue a powercfg /query command
; Vista/7 uses the GUID, XP uses the plain text name - Standards, who needs them?
Local $i, $output, $error $Progress = $Progress & 'Current scheme: '
If _OsVersionTest
($VER_GREATER_EQUAL, 6, 0) Then For $i = 1 To $schemes[0] MsgBox(48, 'PowerMaxTemp error', 'Failed to run powercfg.exe /query') $output = ''
$error = ''
$Progress = $Progress & 'Not read' & ' - Code: ' & @error & @CRLF
; Set RunOnce to restore the current power scheme on reboot
If _OsVersionTest
($VER_GREATER_EQUAL, 6, 0) Then If _StartupRegistry_Install
("PMT", "powercfg.exe /setactive " & $CurrPowSch, 1, 1) = 0 Then $Progress = $Progress & 'Install RunOnce: Fail' & @CRLF $Progress = $Progress & 'Install RunOnce: Done' & @CRLF If _StartupRegistry_Install
("PMT", 'powercfg.exe /setactive "' & $CurrPowSch & '"', 1, 1) = 0 Then $Progress = $Progress & 'Install RunOnce: Fail' & @CRLF $Progress = $Progress & 'Install RunOnce: Done' & @CRLF
; Change the system to use the maximum power scheme, for XP we put quotes around it
If _OsVersionTest
($VER_GREATER_EQUAL, 6, 0) Then Local $foo = Run(@comspec & ' /c powercfg.exe /setactive "' & $MaxPowSch & '"', '.', @SW_HIDE, $STDOUT_CHILD + $STDERR_CHILD) MsgBox(48, 'PowerMaxTemp error', 'Failed to run powercfg.exe /setactive') $cps = ''
$error = ''
$Progress = $Progress & 'Set scheme: Fail' & ' - Code: ' & @error & @CRLF
; When PMT is run, RunOnce is checked for key 'pmt'.
; If it exists: the old scheme is read, the command executed, and the 'pmt' key removed.
; If it doesn't exist the program carries on with setting High performance/Always On scheme.
Local $OldPowSch = RegRead("HKEY_LOCAL_MACHINE64\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "pmt") Local $OldPowSch = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "pmt") $Progress = $Progress & 'Revert: No' & @CRLF $Progress = $Progress & 'Revert: Yes' & @CRLF MsgBox(48, 'PowerMaxTemp error', 'Failed to run ' & $OldPowSch) $cps = ''
$error = ''
$Progress = $Progress & 'Scheme reset: Fail' & ' - Code: ' & @error & @CRLF If _StartupRegistry_Uninstall
("PMT", $OldPowSch, 1, 1) = 0 Then $Progress = $Progress & 'Remove RunOnce: Fail' & @CRLF $Progress = $Progress & 'Remove RunOnce: Done' & @CRLF _Exit()
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.