Windows Properties Performance Profile switcher :think:

Post your working scripts, libraries and tools
User avatar
PipeDreams
Posts: 115
Joined: 19 Dec 2015, 00:20

Windows Properties Performance Profile switcher :think:

16 Mar 2019, 17:57

Hello, I have made a very simple Windows Properties Performance Profile switcher with AHK because I could not get RegEdit files to apply without logging out and back in again after the changes were made. I have tried closing and restarting explorer.exe after making the Registry changes but even that will not work, so I was stumped. The only way I have found to do this without re-logging is to hit the apply or OK buttons in the GUI that is provided by Windows.

How it works: Run the script one time, if Best Appearance is currently the selected profile it will switch to Best Performance. Run it one more time and it will revert back to Best Appearance.


Why is this script useful? Well, I like to switch to performance mode when gaming, and back to Appearance when I am not.


Warning!!! If you are letting Windows choose for you, or if you are using custom profiles, this script will revert them to the default Best Appearance mode. Just FYI. You can always type C:\Windows\System32\SystemPropertiesPerformance.exe in the run prompt to bring up the Performance Options window.


Here’s the AHK Script:

Code: Select all


#SingleInstance Force
#Persistent
#NoEnv

;Windows Properties Performance Profile Switcher By PipeDreams.
SetTimer, CancelChk, 200
GoSub, AskForAdmin
CancelChk: ;This is here to auto click that stupid ERROR msg if you say no to admin privileges. 
{	IfWinExist, New AutoHotkey Script.ahk ;Chang the Named File If You Want.
	{	ExitApp ;If Click NO To Admin Request, Then ExitApp Automagiclly!
}	} Return

AskForAdmin:
{	If Not A_IsAdmin
	{	Run *RunAs "%A_ScriptFullPath%"
	} Else,
	{	SetTimer, CancelChk, OFF
		IfWinNotExist, Performance Options
		{	Run, "C:\Windows\System32\SystemPropertiesPerformance.exe"
			WinWait, Performance Options
			GoSub, ProfileSwap
		} Else,
		{	GoSub, ProfileSwap
}	}	} Return

ProfileSwap:
{	WinActivate, Performance Options
	WinWaitActive, Performance Options
	PixelGetColor, Color, 36, 150, RGB, Fast
	If (Color = "0x333333") ;Check If Best Appearance Is The Current Profile.
	{	ControlClick, Button3, Performance Options ;Adjust For Best Appearance.
		ControlClick, OK, Performance Option ;Applies Setting & Closes The Performance Options Window.
		Sleep, 1000 ;Watch Profiles Switch.
		WinWaitClose, Performance Options
		ExitApp
	} Else,
	{	ControlClick, Button2, Performance Options ;Adjust For Best Performance.
		ControlClick, OK, Performance Options ;Applies Setting & Closes The Performance Options Window.
		Sleep, 1000 ;Watch Profiles Switch.
		WinWaitClose, Performance Options
		ExitApp
}	} Return

~Esc::
ExitApp

However, if you know of a command that can apply reg settings after they have been made without a reboot, (effectively accomplishing the same thing as my script) please let me know.

Here are the reg edit files if anyone wants to play with them:

1 Best Apperance.reg

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects]
"VisualFXSetting"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\AnimateMinMax]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ComboBoxAnimation]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ControlAnimations]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\CursorShadow]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DropShadow]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DWMAeroPeekEnabled]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DWMEnabled]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DWMSaveThumbnailEnabled]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListBoxSmoothScrolling]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewAlphaSelect]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\MenuAnimation]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\SelectionFade]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TaskbarAnimations]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\Themes]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ThumbnailsOrIcon]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TooltipAnimation]
"DefaultApplied"=dword:00000001
2 Best Preformance.reg

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects]
"VisualFXSetting"=dword:00000002

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\AnimateMinMax]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ComboBoxAnimation]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ControlAnimations]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\CursorShadow]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DropShadow]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DWMAeroPeekEnabled]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DWMEnabled]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DWMSaveThumbnailEnabled]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListBoxSmoothScrolling]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewAlphaSelect]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\MenuAnimation]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\SelectionFade]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TaskbarAnimations]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\Themes]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ThumbnailsOrIcon]
"DefaultApplied"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TooltipAnimation]
"DefaultApplied"=dword:00000001

Return to “Scripts and Functions”

Who is online

Users browsing this forum: americanaussie, wenqu and 30 guests