I have a script that sets the power options on my XP machines. I need it updated to work on my new Windows 7 machines. Can anyone please help me figure this out?
My XP Script:
' 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 "Home/Office Desk"
' Turn on Hibernation
WshShell.Run "%COMSPEC% /c POWERCFG /SETACTIVE ""Home/Office Desk"""
WshShell.Run "%COMSPEC% /c POWERCFG /Hibernate OFF"
WshShell.Run "%COMSPEC% /c POWERCFG /GLOBALPOWERFLAG off /OPTION RESUMEPASSWORD"
WshShell.Run "%COMSPEC% /c POWERCFG /GLOBALPOWERFLAG off /OPTION BATTERYICON"
' Start changing Power Management profiles' settings
' Change "Home/Office Desk" profile settings
WshShell.Run "%COMSPEC% /c POWERCFG /CHANGE ""Home/Office Desk"" /monitor-timeout-ac 0 /monitor-timeout-dc 0 /disk-timeout-ac 0 /disk-timeout-dc 0 /standby-timeout-ac 0 /standby-timeout-dc 0 /hibernate-timeout-ac 0 /hibernate-timeout-dc 0 /processor-throttle-ac none /processor-throttle-dc adaptive"
WScript.Sleep intSleepTime
' Cleanup
Set WshShell = Nothing
WScript.Quit(0)
My XP Script:
' 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 "Home/Office Desk"
' Turn on Hibernation
WshShell.Run "%COMSPEC% /c POWERCFG /SETACTIVE ""Home/Office Desk"""
WshShell.Run "%COMSPEC% /c POWERCFG /Hibernate OFF"
WshShell.Run "%COMSPEC% /c POWERCFG /GLOBALPOWERFLAG off /OPTION RESUMEPASSWORD"
WshShell.Run "%COMSPEC% /c POWERCFG /GLOBALPOWERFLAG off /OPTION BATTERYICON"
' Start changing Power Management profiles' settings
' Change "Home/Office Desk" profile settings
WshShell.Run "%COMSPEC% /c POWERCFG /CHANGE ""Home/Office Desk"" /monitor-timeout-ac 0 /monitor-timeout-dc 0 /disk-timeout-ac 0 /disk-timeout-dc 0 /standby-timeout-ac 0 /standby-timeout-dc 0 /hibernate-timeout-ac 0 /hibernate-timeout-dc 0 /processor-throttle-ac none /processor-throttle-dc adaptive"
WScript.Sleep intSleepTime
' Cleanup
Set WshShell = Nothing
WScript.Quit(0)