Power Config 1.2 - Updated 19/08/2010

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Power Config 1.2 - Updated 19/08/2010

Postby trixmoto » Mon Aug 16, 2010 5:59 pm

This script is designed to stop your monitor from automatically switching off according to your power plan whilst MM is playing. This is useful if you want to run a visualisation that should always be visible whilst playing, or if you have speakers built into your monitor.

Once installed, when you start playing a track you will get confirmation in a progress bar to say that the current monitor timeout has been set to "never". When playback stops (for any reason, including shutdown) the previous value will be restored, which is also confirmed in a progress bar (no confirmation on shutdown).

As always, the installation package is available to download from my website. The code is also available here...

Code: Select all
'
' MediaMonkey Script
'
' NAME: PowerConfig 1.2
'
' AUTHOR: trixmoto (http://trixmoto.net)
' DATE : 19/08/2010
'
' INSTALL: Copy to Scripts\Auto directory
'
' FIXES: Fixed script can run twice concurrently
'        Fixed script not compatible with Windows XP
'
 
Option Explicit
Dim PlayTimeout : PlayTimeout = 3000
Dim ProgTimeout : ProgTimeout = 6000

Sub OnStartUp()
  If SDB.IniFile.StringValue("PowerConfig","MonitorTimeoutAC") = "" Then
    SDB.IniFile.IntValue("PowerConfig","MonitorTimeoutAC") = -1
  End If
  Call Script.RegisterEvent(SDB,"OnPlay","Play")   
  Call Script.RegisterEvent(SDB,"OnPlaybackEnd","PlaybackEnd")
  Call Script.RegisterEvent(SDB,"OnShutdown","Shutdown")
  If SDB.Player.isPlaying Then
    Call Play()
  End If 
End Sub

Sub Play()
  Dim prog : Set prog = SDB.Objects("PowerConfigProg")
  If Not (prog Is Nothing) Then
    Exit Sub
  End If
  Set SDB.Objects("PowerConfig") = Nothing
  If SDB.IniFile.IntValue("PowerConfig","MonitorTimeoutAC") = -1 Then
    Set prog = SDB.Progress
    prog.Text = "PowerConfig: Initialising..."
    Set SDB.Objects("PowerConfigProg") = prog
    SDB.ProcessMessages
    Dim wsh : Set wsh = CreateObject("WScript.Shell")
    Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
    Dim dat : dat = Replace(SDB.TemporaryFolder&"\PowerConfig.tmp","\\","\")   
    If fso.FileExists(dat) Then
      Call fso.DeleteFile(dat)
    End If
    Dim cmd : cmd = "%comspec% /c powercfg -getactivescheme >"&dat
    Call wsh.Run(cmd,0,True)
    SDB.ProcessMessages
    If fso.FileExists(dat) Then
      Dim fil : Set fil = fso.OpenTextFile(dat,1,True)
      If fil.AtEndOfStream Then
        Call fil.Close()             
        Call DoXP()
      Else
        Dim str : str = fil.ReadAll
        Call fil.Close()       
        Call DoVista(str)
      End If
    Else
      prog.Text = "PowerConfig: Error - active plan query failed"
      SDB.ProcessMessages                           
    End If
    Dim Tmr : Set Tmr = SDB.CreateTimer(ProgTimeout)
    If Not (Tmr Is Nothing) Then
      Call Script.RegisterEvent(Tmr,"OnTimer","HideProgress")
    End If
  End If
End Sub

Sub DoXP()
  SDB.IniFile.StringValue("PowerConfig","Windows") = "XP"
  Dim prog : Set prog = SDB.Objects("PowerConfigProg")
  Dim wsh : Set wsh = CreateObject("WScript.Shell")
  Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
  Dim dat : dat = Replace(SDB.TemporaryFolder&"\PowerConfig.tmp","\\","\")
  If fso.FileExists(dat) Then
    Call fso.DeleteFile(dat)
  End If 
  Dim cmd : cmd = "%comspec% /c powercfg -query >"&dat
  Call wsh.Run(cmd,0,True)
  SDB.ProcessMessages
MsgBox "1"
  If fso.FileExists(dat) Then
    Dim fil : Set fil = fso.OpenTextFile(dat,1,True)
    Dim str : str = fil.ReadAll
    Call fil.Close()   
    Dim arr : arr = Split(str,VbCrLf)
    If (Left(arr(2),5) = "Name ") And (Left(arr(4),22) = "Turn off monitor (AC) ") Then     
      Dim nam : nam = Trim(Mid(arr(2),5))
      prog.Text = "PowerConfig: Active plan is "&nam&"..."
      SDB.ProcessMessages
      SDB.IniFile.StringValue("PowerConfig","Name") = nam
      str = Trim(Mid(arr(4),22))
      Dim mins : mins = 0
      If Not (str = "Never") Then
        str = Replace(Replace(str,"After",""),"mins","")
        mins = Int(Trim(str))
      End If
      SDB.IniFile.IntValue("PowerConfig","MonitorTimeoutAC") = mins
      If mins = 0 Then           
        prog.Text = "PowerConfig: Active plan is "&nam&"... Monitor timeout already set to Never"
      Else
        cmd = "%comspec% /c powercfg -change "&Chr(34)&nam&Chr(34)&" -monitor-timeout-ac 0" 'Never
        Call wsh.Run(cmd,0,False)
        If mins > 1 Then
          prog.Text = "PowerConfig: Active plan is "&nam&"... Changed monitor timeout from "&mins&" minutes to Never"
        Else
          prog.Text = "PowerConfig: Active plan is "&nam&"... Changed monitor timeout from 1 minute to Never"
        End If
      End If
    Else
      prog.Text = "PowerConfig: Error - current monitor timeout setting not found"
    End If
    Call fso.DeleteFile(dat)
  Else
    prog.Text = "PowerConfig: Error - current monitor settings query failed"                               
  End If                         
  SDB.ProcessMessages
End Sub           

Sub DoVista(str)
  SDB.IniFile.StringValue("PowerConfig","Windows") = "Vista"         
  Dim prog : Set prog = SDB.Objects("PowerConfigProg")
  Dim wsh : Set wsh = CreateObject("WScript.Shell")
  Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
  Dim dat : dat = Replace(SDB.TemporaryFolder&"\PowerConfig.tmp","\\","\")   
  Dim arr : arr = Split(Replace(str,"  "," ")," ")
  Dim nam : nam = Replace(Replace(arr(UBound(arr)),"(",""),")","")
  prog.Text = "PowerConfig: Active plan is "&nam&"..."
  SDB.ProcessMessages
  SDB.IniFile.StringValue("PowerConfig","Name") = nam                             
  If fso.FileExists(dat) Then
    Call fso.DeleteFile(dat)
  End If 
  Dim cmd : cmd = "%comspec% /c powercfg -query "&arr(3)&" 7516b95f-f776-4464-8c53-06167f40cc99 >"&dat 'Display
  Call wsh.Run(cmd,0,True)
  SDB.ProcessMessages
  If fso.FileExists(dat) Then
    Dim fil : Set fil = fso.OpenTextFile(dat,1,True)
    str = fil.ReadAll
    Call fil.Close()   
    Dim pos : pos = InStr(str,"3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e") 'Turn off display after
    pos = InStr(pos,str,"Current AC Power Setting Index:")
    If pos > 0 Then
      str = Mid(str,pos+34,8)
      Dim mins : mins = Int(HexToDec(str)/60)
      SDB.IniFile.IntValue("PowerConfig","MonitorTimeoutAC") = mins
      If mins = 0 Then           
        prog.Text = "PowerConfig: Active plan is "&nam&"... Monitor timeout already set to Never"
      Else
        cmd = "%comspec% /c powercfg -change -monitor-timeout-ac 0" 'Never
        Call wsh.Run(cmd,0,False)
        If mins > 1 Then
          prog.Text = "PowerConfig: Active plan is "&nam&"... Changed monitor timeout from "&mins&" minutes to Never"
        Else
          prog.Text = "PowerConfig: Active plan is "&nam&"... Changed monitor timeout from 1 minute to Never"
        End If
      End If
    Else
      prog.Text = "PowerConfig: Error - current monitor timeout setting not found"
    End If
    Call fso.DeleteFile(dat)
  Else
    prog.Text = "PowerConfig: Error - current monitor settings query failed"                               
  End If
  SDB.ProcessMessages
End Sub

Sub PlaybackEnd()
  If SDB.isRunning Then
    Dim Tmr : Set Tmr = SDB.CreateTimer(PlayTimeout)
    If Not (Tmr Is Nothing) Then
      Call Script.RegisterEvent(Tmr,"OnTimer","ResetValue")
      Set SDB.Objects("PowerConfig") = SDB.NewSongData
    End If
  End If
End Sub

Sub Shutdown()
  Dim mins : mins = SDB.IniFile.IntValue("PowerConfig","MonitorTimeoutAC")
  If mins > -1 Then
    SDB.IniFile.IntValue("PowerConfig","MonitorTimeoutAC") = -1
    If mins > 0 Then 
      Call ResetCommand(mins)   
    End If 
  End If
End Sub

Sub ResetValue(Tmr)
  Call Script.UnregisterEvents(Tmr)
  If Not (SDB.Objects("PowerConfig") Is Nothing) Then
    Dim mins : mins = SDB.IniFile.IntValue("PowerConfig","MonitorTimeoutAC")
    If mins > -1 Then 
      SDB.IniFile.IntValue("PowerConfig","MonitorTimeoutAC") = -1
      If mins > 0 Then
        Call ResetCommand(mins)
        Dim prog : Set prog = SDB.Progress
        If mins > 1 Then
          prog.Text = "PowerConfig: Restored monitor timeout to "&mins&" minutes"
        Else
          prog.Text = "PowerConfig: Restored monitor timeout to 1 minute"
        End If
        Set SDB.Objects("PowerConfigProg") = prog
        SDB.ProcessMessages         
        Dim Tmr2 : Set Tmr2 = SDB.CreateTimer(ProgTimeout)
        If Not (Tmr2 Is Nothing) Then
          Call Script.RegisterEvent(Tmr2,"OnTimer","HideProgress")
        End If             
      End If     
    End If
  End If
End Sub

Sub ResetCommand(mins)
  Dim wsh : Set wsh = CreateObject("WScript.Shell")
  Dim cmd : cmd = ""
  If SDB.IniFile.StringValue("PowerConfig","Windows") = "XP" Then
    Dim nam : nam = SDB.IniFile.StringValue("PowerConfig","Name")
    cmd = "%comspec% /c powercfg -change "&Chr(34)&nam&Chr(34)&" -monitor-timeout-ac "&mins
  Else
    cmd = "%comspec% /c powercfg -change -monitor-timeout-ac "&mins
  End If
  Call wsh.Run(cmd,0,False)
End Sub

Sub HideProgress(Tmr)
  Call Script.UnregisterEvents(Tmr)
  Dim prog : Set prog = SDB.Objects("PowerConfigProg")
  If Not (SDB.Objects("PowerConfigProg") Is Nothing) Then
    Set SDB.Objects("PowerConfigProg") = Nothing
  End If
End Sub

Function HexToDec(h)
  HexToDec = 0
  Dim i : i = 0
  For i = Len(h) To 1 Step -1
    Dim d : d = Mid(h,i,1)
    d = Instr("0123456789ABCDEF",UCase(d))-1
    If d >= 0 Then
      HexToDec = HexToDec+(d*(16^(Len(h)-i)))
    Else
      HexToDec = 0
      Exit For
    End If
  Next
End Function
Download my scripts at trixmoto.net.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE
trixmoto
 
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK

Re: Power Config 1.0 - Created 16/08/2010

Postby Eyal » Tue Aug 17, 2010 2:08 am

Interesting script to try out.

Image
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
Eyal
 
Posts: 3099
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Re: Power Config 1.0 - Created 16/08/2010

Postby trixmoto » Tue Aug 17, 2010 3:36 am

Any chance you could email/PM me "%TEMP%\PowerConfig.tmp" so I can take a look?
Download my scripts at trixmoto.net.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE
trixmoto
 
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK

Re: Power Config 1.0 - Created 16/08/2010

Postby Eyal » Tue Aug 17, 2010 4:06 am

The only file I have is C:\Temp\PowerConfig.tmp and is empty (0 KB).
WIndows XP SP2, MM 3.2.1.1297.

Thanks
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
Eyal
 
Posts: 3099
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Re: Power Config 1.0 - Created 16/08/2010

Postby trixmoto » Tue Aug 17, 2010 10:16 am

Apparently the commands are totally different in XP, so looks like this version will only work on Vista and maybe 7. I don't have XP for testing so that should be interesting trying to make it work in the next version! :lol:
Download my scripts at trixmoto.net.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE
trixmoto
 
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK

Re: Power Config 1.0 - Created 16/08/2010

Postby rovingcowboy » Tue Aug 17, 2010 10:45 am

i can tell you my xp pro sp3 has in the registry some hotkey that lets the settings be set by the control panel's gui link for the power scheme and it is what seems to be blocking any changes of my power scheme being saved. not sure what put that hotkey in there but if i take it out it messes up,
:o :-? :(
roving cowboy / keith hall. My skins viewtopic.php?f=9&t=16724 for some help check on Monkey's helpful messages at viewtopic.php?p=44008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy 5 Android 5) 6. Proscan tablet Android 4.3 ) 7. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.
rovingcowboy
 
Posts: 14149
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)

Re: Power Config 1.0 - Created 16/08/2010

Postby trixmoto » Tue Aug 17, 2010 1:47 pm

I can switch power schemes using a hotkey as well, but this doesn't cause any problems for me because this script just modifies the active scheme.
Download my scripts at trixmoto.net.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE
trixmoto
 
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK

Re: Power Config 1.0 - Created 16/08/2010

Postby rovingcowboy » Tue Aug 17, 2010 3:38 pm

thats what i can do with the panel change to what i want after i reboot. but it won't keep it.

i thought that might be what is messing up on all xp computers? since you had it noted the script is not working in xp.

:)
roving cowboy / keith hall. My skins viewtopic.php?f=9&t=16724 for some help check on Monkey's helpful messages at viewtopic.php?p=44008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy 5 Android 5) 6. Proscan tablet Android 4.3 ) 7. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.
rovingcowboy
 
Posts: 14149
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)

Re: Power Config 1.0 - Created 16/08/2010

Postby trixmoto » Tue Aug 17, 2010 3:47 pm

The command switches are different in XP, that's why the script currently doesn't work.
Download my scripts at trixmoto.net.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE
trixmoto
 
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK

Re: Power Config 1.1 - Updated 17/08/2010

Postby trixmoto » Tue Aug 17, 2010 6:04 pm

New version (1.1) is now available to download from my website. I think I've fixed the "input past end of file" error in XP, but I don't have a test system for XP so if someone could confirm either way that would be great! :)
Download my scripts at trixmoto.net.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE
trixmoto
 
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK

Re: Power Config 1.1 - Updated 17/08/2010

Postby rovingcowboy » Tue Aug 17, 2010 10:50 pm

that bat file in the pm's you said to do does not work in my xp pro sp3.

i found some interesting info.. i remembered the xteq program has settings for the power scheme. but when i opened it
there are 6 listed. but only 3 of them are for xp the others are for win 2k.
and are disabled in xp.

only for some reason the whole user adjustments have been disabled in xp ? only thing i can think of is and update from ms changed all the xp systems. as i've run through all the tweaking programs i have and there is none that have the settings turned off.

so i wonder what ms has done to xp and why they would want to control the power scheme on xp systems? :-?
roving cowboy / keith hall. My skins viewtopic.php?f=9&t=16724 for some help check on Monkey's helpful messages at viewtopic.php?p=44008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy 5 Android 5) 6. Proscan tablet Android 4.3 ) 7. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.
rovingcowboy
 
Posts: 14149
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)

Re: Power Config 1.1 - Updated 17/08/2010

Postby Eyal » Wed Aug 18, 2010 12:44 am

trixmoto wrote:New version (1.1) is now available to download from my website. I think I've fixed the "input past end of file" error in XP, but I don't have a test system for XP so if someone could confirm either way that would be great! :)

Thanks. There's no error anymore, except I get "PowerConfig: Error - plan list not found" on MM's taskbar when play begins.

Here's my PowerConfig.tmp content (without line numbers):

Code: Select all
1
2 Existing Power Schemes
3 ----------------------
4 Max Battery
5 Minimal Power Management
6 Always On
7 Presentation
8 Portable/Laptop
9 Home/Office Desk


Thank you.

Eyal :~)
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
Eyal
 
Posts: 3099
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Re: Power Config 1.1 - Updated 17/08/2010

Postby trixmoto » Wed Aug 18, 2010 3:52 am

Can someone with XP please try opening command prompt (cmd.exe) and running this command...

Code: Select all
powercfg -change -monitor-timeout-ac 0

...and let me know if it changes their current power plan monitor timeout to "Never"?
Download my scripts at trixmoto.net.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE
trixmoto
 
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK

Re: Power Config 1.1 - Updated 17/08/2010

Postby Eyal » Wed Aug 18, 2010 4:22 am

Code: Select all
C:\>powercfg -change -monitor-timeout-ac 0
Invalid Parameters -- try "/?" for help

C:\>
C:\>
C:\>
C:\>
C:\>powercfg /?

POWERCFG [/LIST | /QUERY [name] | /CREATE name | /DELETE name |
       /SETACTIVE name | /CHANGE name settings |
       /HIBERNATE {ON|OFF} | /EXPORT name [/FILE filename] |
       /IMPORT name [/FILE filename] | /GLOBALPOWERFLAG {ON|OFF} /OPTION flag |
       /BATTERYALARM {LOW|CRITICAL} [settings] |
       /DEVICEQUERY queryflags | /DEVICEENABLEWAKE devicename |
       /DEVICEDISABLEWAKE devicename | /?]

Description:
    This command line tool enables an administrator to control
    the power settings on a system.

Parameter List:
    /LIST, /L       Lists the names of existing power schemes.
    /QUERY, /Q      Displays the configuration of the specified power scheme.
                    If no name is specified, the configuration of the currently
                    active power scheme is displayed.
    /CREATE, /C     Creates a power scheme with the specified name.  The new
                    scheme is created with the properties of the currently
                    active scheme.
    /DELETE, /D     Deletes the power scheme with the specified name.
    /SETACTIVE, /S  Makes the power scheme with the specified name active.
    /CHANGE, /X     Changes settings of the specified power scheme. Additional
                    switches specify the changes as follows:
                        /monitor-timeout-ac <minutes>
                        /monitor-timeout-dc <minutes>
                        /disk-timeout-ac <minutes>
                        /disk-timeout-dc <minutes>
                        /standby-timeout-ac <minutes>
                        /standby-timeout-dc <minutes>
                        /hibernate-timeout-ac <minutes>
                        /hibernate-timeout-dc <minutes>
                        /processor-throttle-ac <throttle>
                        /processor-throttle-dc <throttle>
                    AC settings are used when the system is on AC power.
                    DC settings are used when the system is on battery power.
                    Setting a timeout to zero will disable the corresponding
                    timeout feature.  Supported throttle settings are NONE
                    CONSTANT, DEGRADE, and ADAPTIVE.
    /EXPORT, /E     Exports the power scheme with the specified name to a
                    file.  If no filename is specified, the default is
                    SCHEME.POW.  This additional parameter is supported:
                        /FILE <filename>
    /IMPORT, /I     Imports the power scheme from a file under the specified
                    name.  If no filename is specified, the default is
                    SCHEME.POW.  If a scheme with that name already exists, it
                    is replaced with the new one.  This additional parameter
                    is supported:
                        /FILE <filename>
    /HIBERNATE, /H {ON|OFF}  Enables/Disables the hibernate feature.  Hibernate
                    timeout is not supported on all systems.
    /NUMERICAL, /N  Allows the power scheme to be operated upon to be specified
                    using a numerical identifier.  When using this switch, in
                    place of the name of the power scheme on the command line,
                    specify its numerical identifier.  This switch may be used
                    in combination with the /QUERY, /DELETE, /SETACTIVE,
                    /CHANGE, /EXPORT, and /IMPORT commands.
    /GLOBALPOWERFLAG, /G {ON|OFF}  Turns one of the global power flags on/off.
                    Valid flags (to be used after "/OPTION ") are:
                         BATTERYICON:    Turns the battery meter icon in the
                                         system tray on/off.
                         MULTIBATTERY:   Turns on/off multiple battery display
                                         in system Power Meter.
                         RESUMEPASSWORD: Prompt for password on resuming the
                                         system.
                         WAKEONRING:     Turn on/off wake on ring support.
                         VIDEODIM:       Turn on/off support for dimming video
                                         display on battery power.
    /AVAILABLESLEEPSTATES, /A  Reports the sleep states available on the
                    system.  Attempts to report reasons why sleep states are
                    unavailable.
    /BATTERYALARM, /B {LOW|CRITICAL}  Configures the battery alarm.  The
                    following switches can be specified:
                        /activate <on|off>
                            Enables or disables the alarm.
                        /level <percentage (0 - 100)>
                            The alarm will be activated when the power level
                            reaches this percentage.
                        /text <on|off>
                            Turns the text notification on or off.
                        /sound <on|off>
                            Turns the audible notification on or off.
                        /action <none|shutdown|hibernate|standby>
                            Specifies the action to take when this alarm goes
                            off.  Not all actions are always available.
                        /forceaction <on|off>
                            Force stand by or shutdown even if a program stops
                            responding.
                        /program <on|off>
                            Specifies a program to run.  schtasks.exe /change
                           may be used to configure the program.
    /DEVICEQUERY <queryflags> will return a list of devices that meet the
                    criteria specified in <queryflags>.  Possible values
                    for <queryflags> are:
                    wake_from_S1_supported - return all devices that support
                             waking the system from a light sleep state.
                    wake_from_S2_supported - return all devices that support
                             waking the system from a deeper sleep state.
                    wake_from_S3_supported - return all devices that support
                             waking from the deepest sleep state.
                    wake_from_any - return all devices that support waking
                             from any sleep state.
                    S1_supported - list devices supporting light sleep states.
                    S2_supported - list devices supporting deeper sleep.
                    S3_supported - list devices supporting deepest sleep.
                    S4_supported - list devices supporting system hibernation.
                    wake_programmable - list devices that are user-configurable
                             to wake the system from a sleep state.
                    wake_armed - list devices that are currently configured to
                             wake the system from any sleep state.
                    all_devices - return all devices present in the system.
                    all_devices_verbose - return verbose list of devices.
    /DEVICEENABLEWAKE <devicename> enable the device to wake the system from a
                    sleep state. <devicename> is a device retrieved using
                    the '/DEVICEQUERY wake_programmable' parameter.
    /DEVICEDISABLEWAKE <devicename> disable the device from waking the system
                    from a sleep state. <devicename> is a device retrieved
                    using the '/DEVICEQUERY wake_armed' parameter.
    /HELP, /?       Displays information on command-line parameters.

Examples:
    POWERCFG /LIST
    POWERCFG /QUERY scheme
    POWERCFG /QUERY
    POWERCFG /CREATE scheme
    POWERCFG /DELETE scheme
    POWERCFG /SETACTIVE scheme
    POWERCFG /CHANGE scheme /monitor-timeout-dc 15
    POWERCFG /CHANGE scheme /monitor-timeout-dc 0
    POWERCFG /HIBERNATE on
    POWERCFG /EXPORT scheme /file file
    POWERCFG /QUERY number /NUMERICAL
    POWERCFG /GLOBALPOWERFLAG on /OPTION BATTERYICON
    POWERCFG /AVAILABLESLEEPSTATES
    POWERCFG /BATTERYALARM low
    POWERCFG /BATTERYALARM critical /ACTIVATE on /LEVEL 6 /ACTION hibernate
    POWERCFG /DEVICEQUERY wake_armed
    POWERCFG /DEVICEENABLEWAKE "Microsoft USB IntelliMouse Explorer"


C:\>
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
Eyal
 
Posts: 3099
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Re: Power Config 1.1 - Updated 17/08/2010

Postby gwmaclean » Wed Aug 18, 2010 5:06 am

Thanks for making this extension - it's exactly what I sought.
gwmaclean
 

Next

Return to Need Help with Addons?

Who is online

Users browsing this forum: No registered users and 12 guests