Jump to content
kneze

Get GUID of default Power Scheme

Recommended Posts

kneze
how i can determine which is the default Power Scheme and what is GUID of the default Power Scheme. The Line of default Power Scheme is marked with *
I start with this lines;
$path = "C:\temp\power.txt"


If FileExists($path) Then

   filedelete($path)

  Run(@ComSpec & " /c " & 'powercfg.exe -l > C:\temp\power.txt', "", @SW_HIDE)

else

   Run(@ComSpec & " /c " & 'powercfg.exe -l > C:\temp\power.txt', "", @SW_HIDE)

endif

 

 
 

power.txt

Share this post


Link to post
Share on other sites
jguinch

The power scheme marked with * is the active one, not the default.

You can get it from the registry :

$sActivePowerSchemeGUID = RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes", "ActivePowerScheme")
MsgBox(0, "", $sActivePowerSchemeGUID)

 

Edited by jguinch

Share this post


Link to post
Share on other sites
kneze
Thanks for Solution.  i want to read all the available power scheme on remote computer with its GUID and display in the auto IT gui . The next step will be to put Power Scheme to combo box as selection . the script will display all available power scheme on remote computer and the Current Settings of Active Power Scheme . so That I Can Change Power Scheme or individual (see Sample PrintScreen of Power Scheme that i would like to Change). So my script is a attempt to read Details on remote computer and  proces in a script). I would search in Forum for possible solution. Thanks to help again.
 

sample view Power Scheme.png

Share this post


Link to post
Share on other sites
kneze

I try to use _FileCountLines. the script generate txt file with all availabla power schemes on computer. The first line is empty. so _FileCountLines count 0 lines. If i delete manualy first line and run _FileCountLines i receive the correct number of lines. How can i count lines correctly if content of a file has empty lines?

This will work if blank line is not the first one;

$read=FileRead(@ScriptDir&"\test.txt")
Do
    $read=StringReplace($read,@CRLF&@CRLF,@CRLF)
Until @extended=0
FileWrite(@ScriptDir&"\testOut.txt",$read)

 

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.14.2
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here


#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>


$Form2 = GUICreate("Power Management change / check V1.0", 876, 424, 213, 172)
GUISetFont(12, 400, 0, "Arial Narrow")
GUISetBkColor(0xFFFFFF)
$Pic1 = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\chooseTheSleepPlan.jpg", 10, 155, 397, 20)
$PicDimDisplay = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\DimTheDisplay.jpg", 5, 235, 173, 22)
$PicTurnOffDisplay = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\turn_off_display.jpg", 5, 270, 173, 22)
$PicPutToSleep = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\put_the_computer_to_sleep.jpg", 5, 305, 173, 22)
$PicOnBattery = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\onBattery.jpg", 180, 190, 100, 33)
$PicPluggedIn = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\plugged_in.jpg", 310, 190, 100, 33)
$IconStatusUp = GUICtrlCreateIcon("D:\AutoIT_Scripts\change_Power_Management\work_ICONS\Yell_On_B.ico", -1, 365, 335, 16, 16)
$IconStatusDown = GUICtrlCreateIcon("D:\AutoIT_Scripts\change_Power_Management\work_ICONS\Yell_On_B.ico", -1, 815, 380, 16, 16)
$Pic2 = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\ActivePowerScheme.jpg", 10, 135, 179, 22)
$Pic3 = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\AvailablePowerSchemes.jpg", 435, 65, 214, 22)
$InputDimBattery = GUICtrlCreateInput("", 180, 230, 100, 28)
$InputTurnBattery = GUICtrlCreateInput("", 180, 265, 100, 28)
$InputPutBattery = GUICtrlCreateInput("", 180, 300, 100, 28)
$InputDimPlug = GUICtrlCreateInput("", 310, 230, 100, 28)
$InputTurnPlug = GUICtrlCreateInput("", 310, 265, 100, 28)
$InputPutPlug = GUICtrlCreateInput("", 310, 300, 100, 28)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Pic4 = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\PowerManagementTitel.jpg", 5, 5, 415, 45)
$Pic5 = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\line.jpg", 5, 60, 415, 3)
$InputCPname = GUICtrlCreateInput("", 165, 75, 106, 28)
GUICtrlSetFont(-1, 12, 800, 0, "Arial Narrow")
GUICtrlSetBkColor(-1, 0xFFFF00)
$LabelCPname = GUICtrlCreateLabel("CP Name:", 100, 80, 70, 24)
GUICtrlSetFont(-1, 12, 800, 0, "Arial Narrow")
$Pic6 = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\line.jpg", 5, 115, 415, 3)
$Pic7 = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\line.jpg", 5, 410, 855, 3)
$LabelStatusActive = GUICtrlCreateLabel("Status:", 325, 335, 38, 24)
GUICtrlSetFont(-1, 11, 400, 0, "Arial Narrow")
$ButtonCheckActiveScheme = GUICtrlCreateButton("check", 250, 360, 65, 31)
GUICtrlSetFont(-1, 12, 800, 0, "Arial Narrow")
$Buttonturnoffon = GUICtrlCreateButton("Turn off / on", 320, 360, 90, 31)
GUICtrlSetFont(-1, 12, 800, 0, "Arial Narrow")
$ButtonCheckAvailable = GUICtrlCreateButton("check", 640, 365, 65, 31)
GUICtrlSetFont(-1, 12, 800, 0, "Arial Narrow")
$ButtonSET = GUICtrlCreateButton("S E T", 710, 365, 90, 31)
GUICtrlSetFont(-1, 12, 800, 0, "Arial Narrow")
$LabelStatusAvailable = GUICtrlCreateLabel("Status:", 805, 360, 38, 20)
GUICtrlSetFont(-1, 11, 400, 0, "Arial Narrow")
$ListAvailablePowerSchemes = GUICtrlCreateList("", 430, 90, 416, 266)
GUISetState(@SW_SHOW)



 While 1
    $msg = GUIGetMsg()
    Select
        ;Case $GUI_EVENT_CLOSE
             Case $msg = $GUI_EVENT_CLOSE
            Exitloop

            Case $msg = $ButtonCheckActiveScheme
            ;MsgBox(0, "Note", "Button Active Scheme")

               ;save Variable $Input as $PCNamen
               $CPname = GuiCtrlRead($inputCpname)

            If $CPname = "" Then
                MsgBox(16, "Error", "Missing Computer Nr. ")
             Else
            $path = "D:\AutoIT_Scripts\change_Power_Management\temp\"& $CPname & ".txt"

            If FileExists($path) Then

               filedelete($path)

            Run(@ComSpec & " /c " & 'powercfg.exe -l > D:\AutoIT_Scripts\change_Power_Management\temp\' & $CPname & '.txt', "", @SW_HIDE)

            ;GUICtrlSetData($ListAvailablePowerSchemes, "")
            $file = ("D:\AutoIT_Scripts\change_Power_Management\temp" & $CPname & ".txt")
            $lines = _FileCountLines($file)
            MsgBox(64, "Note", "lines:  "& $lines)
           fileclose($path)


            else
            Run(@ComSpec & " /c " & 'powercfg.exe -l > D:\AutoIT_Scripts\change_Power_Management\temp\' & $CPname & '.txt',"", @SW_HIDE)
                   GUICtrlSetData($ListAvailablePowerSchemes, "")
            ;GUICtrlSetData($ListAvailablePowerSchemes, "")
            $file = ("D:\AutoIT_Scripts\change_Power_Management\temp" & $CPname & ".txt")
MsgBox(64, "Note", "lines:  "& $lines)
           fileclose($path)

EndIf
          endif


            Case $msg = $Buttonturnoffon
            ;MsgBox(0, "Note", "Button Turn off")

               ;save Variable $Input as $PCNamen
               $CPname = GuiCtrlRead($inputCpname)

            If $CPname = "" Then
                MsgBox(16, "Error", "Missing Computer Nr. ")
             Else
                MsgBox(0, "Note", "CP Name: " & $Cpname)
             EndIf


            Case $msg = $ButtonCheckAvailable
            ;MsgBox(0, "Note", "Button Check Available!")

               ;save Variable $Input as $PCNamen
               $CPname = GuiCtrlRead($inputCpname)

            If $CPname = "" Then
                MsgBox(16, "Error", "Missing Computer Nr. ")
             Else
                MsgBox(0, "Note", "CP Name: " & $Cpname)
             EndIf


            Case $msg = $ButtonSET
            ;MsgBox(0, "Note", "Button S E T!")

               ;save Variable $Input as $PCNamen
               $CPname = GuiCtrlRead($inputCpname)

            If $CPname = "" Then
                MsgBox(16, "Error", "Missing Computer Nr. ")
             Else
                MsgBox(0, "Note", "CP Name: " & $Cpname)
             EndIf




    EndSelect
 WEnd

 func terminate()                                                                     ;exit
    Exit 0
EndFunc

 

 

 

change_Power_Management.rar

Edited by kneze

Share this post


Link to post
Share on other sites
kneze

this work for me;

 

_FileWriteToLine("C:\scripts\change_Power_Management\temp\" & $CPname & ".txt",1,"",1)
          sleep(100)
            $file = ("C:\scripts\change_Power_Management\temp\" & $CPname & ".txt")

            $lines = _FileCountLines($file)

 

 

Share this post


Link to post
Share on other sites
kneze

button check and set works:)

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>



$Form2 = GUICreate("Power Management change / check V1.0", 1068, 424, 213, 172)
GUISetFont(12, 400, 0, "Arial Narrow")
GUISetBkColor(0xFFFFFF)
$Pic1 = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\chooseTheSleepPlan.jpg", 10, 155, 397, 20)
$PicDimDisplay = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\DimTheDisplay.jpg", 5, 235, 173, 22)
$PicTurnOffDisplay = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\turn_off_display.jpg", 5, 270, 173, 22)
$PicPutToSleep = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\put_the_computer_to_sleep.jpg", 5, 305, 173, 22)
$PicOnBattery = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\onBattery.jpg", 180, 190, 100, 33)
$PicPluggedIn = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\plugged_in.jpg", 310, 190, 100, 33)
$IconStatusUp = GUICtrlCreateIcon("C:\Sysdat\KnezTools\work_ICONS\Yell_On_B.ico", -1, 365, 335, 16, 16)
$IconStatusDown = GUICtrlCreateIcon("C:\Sysdat\KnezTools\work_ICONS\Yell_On_B.ico", -1, 1025, 380, 16, 16)
$Pic2 = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\ActivePowerScheme.jpg", 10, 135, 179, 22)
$Pic3 = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\AvailablePowerSchemes.jpg", 435, 65, 214, 22)
$InputDimBattery = GUICtrlCreateInput("", 180, 230, 100, 28)
GUICtrlSetState(-1, $GUI_DISABLE)
$InputTurnBattery = GUICtrlCreateInput("", 180, 265, 100, 28)
GUICtrlSetState(-1, $GUI_DISABLE)
$InputPutBattery = GUICtrlCreateInput("", 180, 300, 100, 28)
GUICtrlSetState(-1, $GUI_DISABLE)
$InputDimPlug = GUICtrlCreateInput("", 310, 230, 100, 28)
GUICtrlSetState(-1, $GUI_DISABLE)
$InputTurnPlug = GUICtrlCreateInput("", 310, 265, 100, 28)
GUICtrlSetState(-1, $GUI_DISABLE)
$InputPutPlug = GUICtrlCreateInput("", 310, 300, 100, 28)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Pic4 = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\PowerManagementTitel.jpg", 5, 5, 415, 45)
$Pic5 = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\line.jpg", 5, 60, 415, 3)
$InputCPname = GUICtrlCreateInput("", 165, 75, 106, 28)
GUICtrlSetFont(-1, 12, 800, 0, "Arial Narrow")
GUICtrlSetBkColor(-1, 0xFFFF00)
$LabelCPname = GUICtrlCreateLabel("CP Name:", 100, 80, 65, 24)
GUICtrlSetFont(-1, 12, 800, 0, "Arial Narrow")
$Pic6 = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\line.jpg", 5, 115, 415, 3)
$Pic7 = GUICtrlCreatePic("D:\AutoIT_Scripts\change_Power_Management\line.jpg", 5, 408, 1055, 2)
$LabelStatusActive = GUICtrlCreateLabel("Status:", 325, 335, 38, 24)
GUICtrlSetFont(-1, 11, 400, 0, "Arial Narrow")
$ButtonCheckActiveScheme = GUICtrlCreateButton("check", 250, 360, 65, 31)
GUICtrlSetFont(-1, 12, 800, 0, "Arial Narrow")
$Buttonturnoffon = GUICtrlCreateButton("Turn off / on", 320, 360, 90, 31)
GUICtrlSetFont(-1, 12, 800, 0, "Arial Narrow")
$ButtonCheckAvailable = GUICtrlCreateButton("check", 850, 365, 65, 31)
GUICtrlSetFont(-1, 12, 800, 0, "Arial Narrow")
$ButtonSET = GUICtrlCreateButton("S E T", 920, 365, 90, 31)
GUICtrlSetFont(-1, 12, 800, 0, "Arial Narrow")
$LabelStatusAvailable = GUICtrlCreateLabel("Status:", 1015, 360, 41, 20)
GUICtrlSetFont(-1, 11, 400, 0, "Arial Narrow")
$ListAvailablePowerSchemes = GUICtrlCreateList("", 430, 90, 631, 266)
GUISetState(@SW_SHOW)




 While 1
    $msg = GUIGetMsg()
    Select
        ;Case $GUI_EVENT_CLOSE
             Case $msg = $GUI_EVENT_CLOSE
            Exitloop

            Case $msg = $ButtonCheckActiveScheme
            ;MsgBox(0, "Note", "Für Button Active Scheme ist noch keine Funktion hinterlegt !")

            GUICtrlSetImage($IconStatusUp, "D:\AutoIT_Scripts\change_Power_Management\work_ICONS\Yell_On_B.ico")
            GUICtrlSetImage($IconStatusDown, "D:\AutoIT_Scripts\change_Power_Management\work_ICONS\Yell_On_B.ico")
            sleep(1000)

               ;save Variable $Input as $PCNamen
               $CPname = GuiCtrlRead($inputCpname)

            If $CPname = "" Then
                MsgBox(16, "Error", "Missing Computer Nr. ")
             Else

          GUICtrlSetImage($IconStatusUp, "D:\AutoIT_Scripts\change_Power_Management\work_ICONS\Red_Off_B.ico")

            $path = "D:\AutoIT_Scripts\change_Power_Management\temp\"& $CPname & ".txt"

            If FileExists($path) Then

               filedelete($path)

            Run(@ComSpec & " /c " & 'powercfg.exe -l > D:\AutoIT_Scripts\change_Power_Management\temp\' & $CPname & '.txt', "", @SW_HIDE)

            GUICtrlSetData($ListAvailablePowerSchemes, "")
            _FileWriteToLine("D:\AutoIT_Scripts\change_Power_Management\temp\" & $CPname & ".txt",1,"",1)
          sleep(1000)
          $file = ("D:\AutoIT_Scripts\change_Power_Management\temp\" & $CPname & ".txt")
          $lines = _FileCountLines($file)
          ;MsgBox(64, "Note", "lines:  "& $lines)

          for $x = 4 to $lines
             $sText=FileReadLine($file, $x)

         $sTextShort = StringMid($sText, 19, 70)

 _GUICtrlListBox_AddString ($ListAvailablePowerSchemes, $sTextShort)
 ;_GUICtrlListBox_AddString ( $ListAvailablePowerSchemes, $sText)

 next

           fileclose($path)

    GUICtrlSetImage($IconStatusUp, "D:\AutoIT_Scripts\change_Power_Management\work_ICONS\Grn_Off_B.ico")

            else

            Run(@ComSpec & " /c " & 'powercfg.exe -l > D:\AutoIT_Scripts\change_Power_Management\temp\' & $CPname & '.txt',"", @SW_HIDE)

            GUICtrlSetData($ListAvailablePowerSchemes, "")

            _FileWriteToLine("D:\AutoIT_Scripts\change_Power_Management\temp\" & $CPname & ".txt",1,"",1)
         sleep (1000)
            $file = ("D:\AutoIT_Scripts\change_Power_Management\temp\" & $CPname & ".txt")

            $lines = _FileCountLines($file)

        ;MsgBox(64, "Note", "lines:  "& $lines)

          for $x = 4 to $lines
             $sText=FileReadLine($file, $x)
             $sTextShort = StringMid($sText, 19, 70)
 _GUICtrlListBox_AddString ($ListAvailablePowerSchemes, $sTextShort)

 next

           fileclose($path)
GUICtrlSetImage($IconStatusUp, "D:\AutoIT_Scripts\change_Power_Management\work_ICONS\Grn_Off_B.ico")
EndIf
          endif


            Case $msg = $Buttonturnoffon
            ;MsgBox(0, "Note", "Button Turn off on!")

               ;save Variable $Input as $PCNamen
               $CPname = GuiCtrlRead($inputCpname)

            If $CPname = "" Then
                MsgBox(16, "Error", "Missing Computer Nr. ")
             Else
                MsgBox(0, "Note", "CP Name: " & $Cpname)
             EndIf


            Case $msg = $ButtonCheckAvailable
            ;MsgBox(0, "Note", "Button Check Available!")

               ;save Variable $Input as $PCNamen
               $CPname = GuiCtrlRead($inputCpname)

            If $CPname = "" Then
                MsgBox(16, "Error", "Missing Computer Nr. ")
             Else
                MsgBox(0, "Note", "CP Name: " & $Cpname)
             EndIf


            Case $msg = $ButtonSET
            ;MsgBox(0, "Note", "Button S E T !")

            GUICtrlSetImage($IconStatusDown, "D:\AutoIT_Scripts\change_Power_Management\work_ICONS\\Yell_On_B.ico")
            sleep(1000)
               ;save Variable $Input as $PCNamen
               $CPname = GuiCtrlRead($inputCpname)

            If $CPname = "" Then
                MsgBox(16, "Error", "Missing Computer Nr. ")
             Else

            GUICtrlSetImage($IconStatusDown, "D:\AutoIT_Scripts\change_Power_Management\work_ICONS\\Red_Off_B.ico")

        $sTextShort = StringMid($sText, 19, 70)
        $marked_index = _GUICtrlListBox_GetCurSel($ListAvailablePowerSchemes)
        $marked_name = _GUICtrlListBox_GetText($ListAvailablePowerSchemes, $marked_index)
        $sTextScheme = StringMid($marked_name, 38, 70)
        $sTextGUID = StringMid($marked_name, 1, 37)
        IF $sTextGUID = "0" then
             MsgBox(16, "Error", "no Power Scheme selected !")
             Else
        ;MsgBox(64, "Note", "Scheme: " & $sTextScheme & @CRLF & "GUID: " & $sTextGUID)
        Run(@ComSpec & " /c " & 'powercfg.exe -setactive' & $sTextGUID,"", @SW_HIDE)

        GUICtrlSetImage($IconStatusDown, "D:\AutoIT_Scripts\change_Power_Management\work_ICONS\\Grn_Off_B.ico")
     EndIf
     EndIf




    EndSelect
 WEnd

 func terminate()                                                                     ;exit
    Exit 0
EndFunc

 

Share this post


Link to post
Share on other sites
kneze

hi, now i try to read Current Settings for "sleep after" / "Dim display after" and "Turn off Display after". first step is Export of Settings to TXT File. i search for line (sleep after) and get values for "Current AC Power Settings" "Current DC Power Settings"  Sample of Export and PrintScreen are attached. In the PrintScreen are marked specific Lines and values which i would like to have.

My code it works but it can be optimized. i have the values as HEX and now i don't know how to get hour and minutes. 

#include <File.au3>

$file = "C:\temp\change_Power_Management\balanced.txt"

FileOpen($file, 0)

For $i = 1 to _FileCountLines($file)
    $line = FileReadLine($file, $i)

If StringInStr($line, "sleep after") then

   $sleepAfterCurrentACPowerLine = $i + 5
   $sleepAfterCurrentACPower = FileReadLine($file, $sleepAfterCurrentACPowerLine)

   $sleepAfterCurrentACPowerShort = StringMid($sleepAfterCurrentACPower, 36, 11)

   $sleepAfterCurrentDCPowerLine = $sleepAfterCurrentACPowerLine + 1
   $sleepAfterCurrentDCPower = FileReadLine($file, $sleepAfterCurrentDCPowerLine)

   $sleepAfterCurrentDCPowerShort = StringMid($sleepAfterCurrentDCPower, 36, 11)

MsgBox(64, "Note", "Sub Scheme: " & "Sleep after"& @CRLF & @CRLF & "Current AC Power Setting Index: "& $sleepAfterCurrentACPowerShort & @CRLF & "Current DC Power Setting Index: " & $sleepAfterCurrentDCPowerShort)


EndIf
Next

For $i = 1 to _FileCountLines($file)
    $line = FileReadLine($file, $i)

If StringInStr($line, "Dim display after") then

   $sleepAfterCurrentACPowerLine = $i + 5
   $sleepAfterCurrentACPower = FileReadLine($file, $sleepAfterCurrentACPowerLine)

   $sleepAfterCurrentACPowerShort = StringMid($sleepAfterCurrentACPower, 36, 11)

   $sleepAfterCurrentDCPowerLine = $sleepAfterCurrentACPowerLine + 1
   $sleepAfterCurrentDCPower = FileReadLine($file, $sleepAfterCurrentDCPowerLine)

   $sleepAfterCurrentDCPowerShort = StringMid($sleepAfterCurrentDCPower, 36, 11)

MsgBox(64, "Note", "Sub Scheme: " & "Dim display after"& @CRLF & @CRLF & "Current AC Power Setting Index: "& $sleepAfterCurrentACPowerShort & @CRLF & "Current DC Power Setting Index: " & $sleepAfterCurrentDCPowerShort)


EndIf
Next

For $i = 1 to _FileCountLines($file)
    $line = FileReadLine($file, $i)

If StringInStr($line, "Turn off display after") then

   $sleepAfterCurrentACPowerLine = $i + 5
   $sleepAfterCurrentACPower = FileReadLine($file, $sleepAfterCurrentACPowerLine)

   $sleepAfterCurrentACPowerShort = StringMid($sleepAfterCurrentACPower, 36, 11)

   $sleepAfterCurrentDCPowerLine = $sleepAfterCurrentACPowerLine + 1
   $sleepAfterCurrentDCPower = FileReadLine($file, $sleepAfterCurrentDCPowerLine)

   $sleepAfterCurrentDCPowerShort = StringMid($sleepAfterCurrentDCPower, 36, 11)

MsgBox(64, "Note", "Sub Scheme: " & "Turn off display after"& @CRLF & @CRLF & "Current AC Power Setting Index: "& $sleepAfterCurrentACPowerShort & @CRLF & "Current DC Power Setting Index: " & $sleepAfterCurrentDCPowerShort)


EndIf
Next

FileClose($file)

active power scheme.jpg

balanced.txt

Edited by kneze

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • argumentum
      By argumentum
      The back story:
      I've got a Dell XPS w/ i7-8700K. The fastest, by single core, I could get, by well known PC maker.
      The problem is that the fan can get so loud, like, REALLY LOUD, I can not use the CPU at its max. clock speed.
      I could leave it at 90% all the time and not use this but I want to have the full 4.x Ghz and no parked cores, at all times, if I can.
      But as room temperature and CPU load changes, a set throttle, may still make fan noise.
      The solution:
      To avoid the fan from going "airplane turbine mode", the utility gets the temp. from "Core Temp" ( you can google it )
      It has a"plug-in" called "Core Temp Remote Server". The utility gets the values via TCP.
      When it "feels" it's gonna get hot, drops the CPU throttle to a selected value, lets say 99% ( where is quieter ) and back up to 100% when it "feels" is ok to go back.
      Now temperature can creep up to higher than expected if load is sustained or room temperature changes. So there is an "anti creep up" feature, to temporarily set the throttle even lower, 5% at a time, until the known quiet temperature is achieved.
      If don't know how to find the temperature you should use, check out these videos. They will tell you how.
      https://www.youtube.com/watch?v=p3B5WCJZTuw&ab_channel=SergeantPope-KomadaComputerRepair
      https://www.youtube.com/watch?v=VuP6I0mOb1s&ab_channel=Techquickie
      https://www.google.com/search?q=find+max+cpu+temperature
      The end result:
      Any thermal problem, is a hardware problem. No way around that, other than attending to the CPU cooling and case ventilation. Software can not fix that.
      But without this utility, the PC would slow down the CPU anyway, to keep it from melting.
      This software preemptively slow down the CPU, keeping the CPU related fan speeds from going to maximum RPM. Hence having a slower, but a quieter box.
      The files are in the download section of the forum.
×