• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Script for Power Options

Joined
Jun 5, 2007
Messages
2,147 (0.35/day)
Location
Metro Manila, Philippines
System Name Zangief (Reborn)
Processor AMD Ryzen R7 1700X @ 3.825ghz , 1.35v
Motherboard Gigabyte GA-AX370 Gaming K7 Rev 1.0 BIOS F51e
Cooling Noctua NH-D15 Push / Push Config | 2x ML120 | 2x Phanteks 120 mm
Memory 2x8GB G.Skill Trident Z @ 3200mhz cl 16 @ 1.45v
Video Card(s) Gigabyte Aorus GTX 1080 +100 core / +550 mem
Storage 250 GB Samsung Evo 850 / 1tb WD Black / 4tb WD Blue / 512GB Adata XPG Pro SX8200
Display(s) Acer Predator XB271HU |Asus VX239H 23" AH-IPS Led
Case Phanteks Enthoo Pro M TG
Audio Device(s) On Board Realtek HD / Logitech G633/G933 Gaming Headset / Corsair H70 Pro Wireless
Power Supply Corsair HX750i
Mouse Logitech G903 and G602 Wireless Gaming | Logitech Proteus Core G502
Keyboard Corsair K70 Cherry Red | Corsair K70 RGB MK.2 Cherry Browns | Akko 3908N TTC Flame Reds
Software Windows 11 Pro
Specifically for pausing desktop slideshow.

Can anyone guide or help me set up a If -- Else script for toggling pause and available options for current power scheme.
Basically change Power Options > Advanced power settings > Desktop Settings > Slide show.
I can do it via cmd/powershell with powercfg but not really good with making a complex script.
like a 1 click on and off script that can read the value or something like that.

The command which can do this is.
powercfg -setacvalueindex or powercfg -setdcvalueindex plus the GUID of the setting.

Thank you.
 

Solaris17

Super Dainty Moderator
Staff member
Joined
Aug 16, 2005
Messages
25,887 (3.79/day)
Location
Alabama
System Name Rocinante
Processor I9 14900KS
Motherboard EVGA z690 Dark KINGPIN (modded BIOS)
Cooling EK-AIO Elite 360 D-RGB
Memory 64GB Gskill Trident Z5 DDR5 6000 @6400
Video Card(s) MSI SUPRIM Liquid X 4090
Storage 1x 500GB 980 Pro | 1x 1TB 980 Pro | 1x 8TB Corsair MP400
Display(s) Odyssey OLED G9 G95SC
Case Lian Li o11 Evo Dynamic White
Audio Device(s) Moondrop S8's on Schiit Hel 2e
Power Supply Bequiet! Power Pro 12 1500w
Mouse Lamzu Atlantis mini (White)
Keyboard Monsgeek M3 Lavender, Akko Crystal Blues
VR HMD Quest 3
Software Windows 11
Benchmark Scores I dont have time for that.
powercfg -setacvalueindex or powercfg -setdcvalueindex


what is this index? is the value a number? do you know between what and what?

nvm seems like its

powercfg -setacvalueindex or powercfg -setdcvalueindex

are those the only two you need to toggle between?


no scratch that those are not valid flags, those are just the set value flags. Do you know the flag specifically for slide show?

ah ok, nvm I understand.

I can do this. Do you have a custom power plan? Or do you switch power plans often? The default plans are known GUIDs I can do this faster if I can be a bit lazy and just modify the default plans. If you use a custom one then I need to poll the current guid and make it a variable.
 
Last edited:
Joined
Jun 5, 2007
Messages
2,147 (0.35/day)
Location
Metro Manila, Philippines
System Name Zangief (Reborn)
Processor AMD Ryzen R7 1700X @ 3.825ghz , 1.35v
Motherboard Gigabyte GA-AX370 Gaming K7 Rev 1.0 BIOS F51e
Cooling Noctua NH-D15 Push / Push Config | 2x ML120 | 2x Phanteks 120 mm
Memory 2x8GB G.Skill Trident Z @ 3200mhz cl 16 @ 1.45v
Video Card(s) Gigabyte Aorus GTX 1080 +100 core / +550 mem
Storage 250 GB Samsung Evo 850 / 1tb WD Black / 4tb WD Blue / 512GB Adata XPG Pro SX8200
Display(s) Acer Predator XB271HU |Asus VX239H 23" AH-IPS Led
Case Phanteks Enthoo Pro M TG
Audio Device(s) On Board Realtek HD / Logitech G633/G933 Gaming Headset / Corsair H70 Pro Wireless
Power Supply Corsair HX750i
Mouse Logitech G903 and G602 Wireless Gaming | Logitech Proteus Core G502
Keyboard Corsair K70 Cherry Red | Corsair K70 RGB MK.2 Cherry Browns | Akko 3908N TTC Flame Reds
Software Windows 11 Pro
what is this index? is the value a number? do you know between what and what?

nvm seems like its

powercfg -setacvalueindex or powercfg -setdcvalueindex

are those the only two you need to toggle between?


no scratch that those are not valid flags, those are just the set value flags. Do you know the flag specifically for slide show?

ah ok, nvm I understand.

I can do this. Do you have a custom power plan? Or do you switch power plans often? The default plans are known GUIDs I can do this faster if I can be a bit lazy and just modify the default plans. If you use a custom one then I need to poll the current guid and make it a variable.


Hey there sorry for the delayed response.
I just use one power plan wihich is the Ryzen Balanced plan.
When I can get to the puter when I get home, I will put the guid's of the plan and the categories/sub categories.

On my own I managed to make a vbscript that can execute it but I need to have it store a file locally to put a marker that it paused or not, because when the script runs it exits and thinks that it starts again from the beggining.

I was trying to see if I can make it read the actual setting but I am limited with my coding skills.


Thank you in advance, I'll let you know the information when I get home.

EDIT:

Hello, these are the guids :)

9897998c-92de-4669-853f-b7cd3ecb2790 - Ryzen Balanced Plan
0d7dbae2-4294-402a-ba8e-26777e8488cd - Desktop BG Settings
309dce9b-bef4-4119-9921-a851fb12f0f4 - Slide show


This is vbs that I came up with but as I told earlier it quits it self and I haven't figured out how to make it read the current setting so that the IF Else work.

Thanks in advance and no rush. :)

Code:
Option Explicit

Dim WshShell
Dim Exec
Dim Enabled

Set WshShell = WScript.CreateObject("WScript.Shell")
Exec = "C:\Windows\SysWOW64\powercfg.exe"
Enabled = 0


If Enabled = 0 Then
    WshShell.Run (Exec) & " /SETACVALUEINDEX 9897998c-92de-4669-853f-b7cd3ecb2790 0d7dbae2-4294-402a-ba8e-26777e8488cd 309dce9b-bef4-4119-9921-a851fb12f0f4 1 "
    WshShell.Run (Exec) & " /SETDCVALUEINDEX 9897998c-92de-4669-853f-b7cd3ecb2790 0d7dbae2-4294-402a-ba8e-26777e8488cd 309dce9b-bef4-4119-9921-a851fb12f0f4 1 "
    Enabled = 1
    WScript.Echo "Slideshow Paused"
    WScript.Quit
Else
    WshShell.Run (Exec) & " /SETACVALUEINDEX 9897998c-92de-4669-853f-b7cd3ecb2790 0d7dbae2-4294-402a-ba8e-26777e8488cd 309dce9b-bef4-4119-9921-a851fb12f0f4 0 "
    WshShell.Run (Exec) & " /SETDCVALUEINDEX 9897998c-92de-4669-853f-b7cd3ecb2790 0d7dbae2-4294-402a-ba8e-26777e8488cd 309dce9b-bef4-4119-9921-a851fb12f0f4 0 "
    Enabled = 0
    WScript.Echo "Slideshow Enabled"
    WScript.Quit
End If

WScript.Quit
 
Last edited:
Top