Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows 7 Power Options

Status
Not open for further replies.

UglyDogNH

IS-IT--Management
Jul 11, 2011
21
0
0
US
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)
 
I think you need to reference the GUID of the current profile. The bottom of this article pertains to Windows Vista, but Vista and 7 have the same power applet.

WshShell.Run "%COMSPEC% /c POWERCFG /CHANGE ""Home/Office Desk"" [red]GUID[/red] /monitor-timeout-ac 0 /monitor-timeout-dc 0 ...


-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top