Sign in to follow this  
Followers 0
Chimaera

How to set dim display switched off on machine?

4 posts in this topic

#1 ·  Posted (edited)

I have a script that makes a few setting changes but the one i cant seem to sort is dim display

I set the ones so far like this

ShellExecute("powercfg.exe", '-change -monitor-timeout-ac 0')
        ShellExecute("powercfg.exe", '-change -standby-timeout-ac 0')

Does anyone know a way to set the ac dim display to 0 ?

Ive as yet not been able to find a way to do this

Edited by Chimaera

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

With the first one i had tried 

ShellExecute("powercfg.exe", '-SETACVALUEINDEX 381b4222-f694-41f0-9685-ff5bb260df2e 7516b95f-f776-4464-8c53-06167f40cc99 17aaa29b-8b43-4b94-aafe-35f64daaf1ee 0')

But i seem to remember it crashed the script or machine so i didnt use it again

Just wondering now if i tried it on a Vista Machine maybe? ill have torun some tests and see

Ill have a read thanks

 

Edited by Chimaera

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hey, try it once like that.
This script first reads the active scheme, and then sets the index value.

#include <constants.au3>

; powercfg -getactivescheme
$PID = Run("powercfg -getactivescheme", "", @SW_HIDE, $STDOUT_CHILD)
$szLines = ""
While 1
    $szLines &= StdoutRead($PID)
    If @error Then ExitLoop
WEnd

; read GUID from active scheme
$szGUID = StringRegExp($szLines, "(?m):\s+([[:xdigit:]\-]+)\s+", 3)[0]
ConsoleWrite($szGUID & @CRLF)

;powercfg -setacvalueindex <SCHEME_GUID> <SUB_GUID> <SETTING_GUID> <SettingIndex>
ShellExecute("powercfg", "-setacvalueindex " & $szGUID & " 7516b95f-f776-4464-8c53-06167f40cc99 17aaa29b-8b43-4b94-aafe-35f64daaf1ee 0", "", Default, @SW_HIDE)
ShellExecute("powercfg", "-setdcvalueindex " & $szGUID & " 7516b95f-f776-4464-8c53-06167f40cc99 17aaa29b-8b43-4b94-aafe-35f64daaf1ee 0", "", Default, @SW_HIDE)

 

Edited by bernd670

greetings
bernd


I hacked 127.0.0.1 -> pcfred6.gif

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
Sign in to follow this  
Followers 0