'==========================================================================
'
' NAME: PowerManagement.vbs
'
' AUTHOR: Sergey Karasev
' E-MAIL: skarasev@gmail.com
' DATE : 5/26/2005
'
'==========================================================================
' Power Management Profiles:
' 0 = Home/Office Desk
' 1 = Portable/Laptop
' 2 = Presentation
' 3 = Always On
' 4 = Minimal Power Management
' 5 = Max Battery
' 6 = Custom Profile
Dim intSleepTime
intSleepTime = 5000
Set WshShell = WScript.CreateObject("WScript.Shell")
' Set the Default to be "Custom Profile"
' Turn on Hibernation
WshShell.Run "%COMSPEC% /c POWERCFG /SETACTIVE ""Custom Profile"""
WshShell.Run "%COMSPEC% /c POWERCFG /Hibernate On"
' Start changing Power Management profiles' settings
' Change "Home/Office Desk" profile settings
WshShell.Run "%COMSPEC% /c POWERCFG /CHANGE ""Home/Office Desk"" /monitor-timeout-ac 20 /monitor-timeout-dc 5 /disk-timeout-ac 0 /disk-timeout-dc 10 /standby-timeout-ac 0 /standby-timeout-dc 15 /hibernate-timeout-ac 0 /hibernate-timeout-dc 30 /processor-throttle-ac none /processor-throttle-dc adaptive"
WScript.Sleep intSleepTime
' Change "Portable/Laptop" profile settings
WshShell.Run "%COMSPEC% /c POWERCFG /CHANGE ""Portable/Laptop"" /monitor-timeout-ac 20 /monitor-timeout-dc 5 /disk-timeout-ac 0 /disk-timeout-dc 10 /standby-timeout-ac 0 /standby-timeout-dc 15 /hibernate-timeout-ac 0 /hibernate-timeout-dc 20 /processor-throttle-ac adaptive /processor-throttle-dc adaptive"
WScript.Sleep intSleepTime
' Change "Presentation" profile settings
WshShell.Run "%COMSPEC% /c POWERCFG /CHANGE ""Presentation"" /monitor-timeout-ac 0 /monitor-timeout-dc 0 /disk-timeout-ac 0 /disk-timeout-dc 5 /standby-timeout-ac 0 /standby-timeout-dc 15 /hibernate-timeout-ac 0 /hibernate-timeout-dc 120/processor-throttle-ac adaptive /processor-throttle-dc degrade"
WScript.Sleep intSleepTime
' Change "Always On" profile settings
WshShell.Run "%COMSPEC% /c POWERCFG /CHANGE ""Always On"" /monitor-timeout-ac 20 /monitor-timeout-dc 15 /disk-timeout-ac 0 /disk-timeout-dc 30 /standby-timeout-ac 0 /standby-timeout-dc 0 /hibernate-timeout-ac 0 /hibernate-timeout-dc 0 /processor-throttle-ac none /processor-throttle-dc none"
WScript.Sleep intSleepTime
' Change "Minimal Power Management" profile settings
WshShell.Run "%COMSPEC% /c POWERCFG /CHANGE ""Minimal Power Management"" /monitor-timeout-ac 15 /monitor-timeout-dc 5 /disk-timeout-ac 0 /disk-timeout-dc 15 /standby-timeout-ac 0 /standby-timeout-dc 5 /hibernate-timeout-ac 0 /hibernate-timeout-dc 180 /processor-throttle-ac adaptive /processor-throttle-dc adaptive"
WScript.Sleep intSleepTime
' Change "Max Battery" profile settings
WshShell.Run "%COMSPEC% /c POWERCFG /CHANGE ""Max Battery"" /monitor-timeout-ac 15 /monitor-timeout-dc 1 /disk-timeout-ac 0 /disk-timeout-dc 3 /standby-timeout-ac 20 /standby-timeout-dc 2 /hibernate-timeout-ac 45 /hibernate-timeout-dc 60 /processor-throttle-ac adaptive /processor-throttle-dc degrade"
WScript.Sleep intSleepTime
' Change "UnitedHealth Group" profile settings
WshShell.Run "%COMSPEC% /c POWERCFG /CHANGE ""Custom Profile"" /monitor-timeout-ac 20 /monitor-timeout-dc 5 /disk-timeout-ac 0 /disk-timeout-dc 10 /standby-timeout-ac 0 /standby-timeout-dc 5 /hibernate-timeout-ac 0 /hibernate-timeout-dc 20 /processor-throttle-ac adaptive /processor-throttle-dc adaptive"
WScript.Sleep intSleepTime
' Cleanup
Set WshShell = Nothing
WScript.Quit(0)