Re: Re: Energy options permissions?

Forums General Feedback Energy options permissions? Re: Re: Energy options permissions?

#45641
Arris
Moderator

hey Karstux,

You can use the following workaround:
In the command type:

powercfg /l

My output is for example:

Existing Power Schemes (* Active)

Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced)
Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance) *
Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver)

Now create a batch file with the following content, change the guid’s/names to the ones you got when executing powercfg /L:

@echo off
echo Wich Powerplan do you want to use?
echo [1] Balanced
echo [2] High performance
echo [3] Power saver
echo Powerplan: && set /p plan=

if %plan% == 1 set guid=381b4222-f694-41f0-9685-ff5bb260df2e
if %plan% == 2 set guid=8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
if %plan% == 3 set guid=a1841308-3541-4fab-bc81-f71556f20b4a

runas /user:Administrator "cmd /c powercfg /setactive %guid%"
ping localhost -n 1 -w 1000>nul
echo.
echo Powerplan is now:
powercfg /L|find ") *"
echo.

pause

Example of execution:

C:UsersAdministratorDesktop>powercfg /l

Existing Power Schemes (* Active)
Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced)
Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance) *
Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver)

C:UsersAdministratorDesktop>changePowerPlan.bat
Wich Powerplan do you want to use?
[1] Balanced
[2] High performance
[3] Power saver
Powerplan:
1
Enter the password for Administrator:
Attempting to start cmd /c powercfg /setactive 381b4222-f694-41f0-9685-ff5bb260d
f2e as user "COMPUTER01Administrator" ...

Powerplan is now:
Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced) *

Press any key to continue . . .

C:UsersAdministratorDesktop>

You can tweak it by for example removing the pause and echo’s after the runas command or to use parameters so you can just make a shortcut for the different powerplans and only enter your password when changing.

Hope this helps you a bit! 😉