Adjust for Best Performance: Windows Themes and Power

These are 2 low-hanging fruit settings that make SQL Server run better. Adjust theme for Best Performance and power option for High Performance.

0.Run.bat – Run as administrator!

@ECHO ********** Cmds Started %DATE% %TIME% ********** >>Output.txt

Set Server=ProdSvrSQL1
Set UptoScript=99

@ECHO "%Server%" STARTED!!! >>Output.txt


rem IF %userdnsdomain%\%username% == FLEITASARTS.COM\_sql_service GOTO PART2
@ECHO "2.BestPerformanceRestartThemes.cmd" STARTED!!! >>Output.txt
call 2.BestPerformanceRestartThemes.cmd >> Output.txt

@ECHO "2.PowerOptions.cmd" STARTED!!! >>Output.txt
if %UptoScript% LEQ 0 GOTO Verify
call 2.PowerOptions.cmd >> Output.txt

@ECHO "%Server%" COMPLETED!!! >>Output.txt

rem sqlcmd  /S "%Server%" /d "%Database%" /i "Scripts/Verify.Sql" /b >>Output.txt

echo. >>Output.txt
@ECHO ************* %DATE% %TIME% ************* >>Output.txt


echo Date: %Date% %Time%  PublishErrorlevel:%errorlevel% >>Output.txt

call Output.txt



; ###
; Visual Effects
; ###


; Do not Animate windows when minimizing and maximizing
[HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics]

; Disable Animations in Taskbar and Start Menu

; Disable desktop composition

; Enable transparent glass

; Disable Taskbar Thumbnail Previews

; Disable Explorer Thumbnails (All Users)

; Disable translucent selection rectangle

; Dont show window contents while dragging
[HKEY_CURRENT_USER\Control Panel\Desktop]

; Dont smooth Edges of Screen Fonts
[HKEY_CURRENT_USER\Control Panel\Desktop]

; Use drop shadows for icon labels on the desktop

; Disable visual styles on windows and buttons

; Disable following:
; * Animate controls and elements inside windows
; * Smooth-scroll list boxes
; * Slide open combo boxes
; * Fade or slide menus into view
; * Show shadows under mouse pointer
; * Fade or slide ToolTips into view
; * Fade out menu items after clicking
; * Show shadows under windows
; * Use Visual styles on windows and buttons
[HKEY_CURRENT_USER\Control Panel\Desktop]



reg export "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" "C:\fleitasarts\1.BestPerf.HKCUVisualEffects.BAK.reg" /y /reg:64
reg export "HKCU\Control Panel\Desktop\WindowMetrics" "C:\fleitasarts\1.BestPerf.HKCUWindowMetrics.BAK.reg" /y /reg:64
reg export "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "C:\fleitasarts\1.BestPerf.HKCUAdvanced.BAK.reg" /y /reg:64
reg export "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "C:\fleitasarts\1.BestPerf.HKLMAdvanced.BAK.reg" /y /reg:64
reg export "HKCU\Software\Microsoft\Windows\DWM" "C:\fleitasarts\1.BestPerf.HKCUDWM.BAK.reg" /y /reg:64
reg export "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" "C:\fleitasarts\1.BestPerf.HKCUExplorer.BAK.reg" /y /reg:64
reg export "HKCU\Control Panel\Desktop" "C:\fleitasarts\1.BestPerf.HKCUDesktop.BAK.reg" /y /reg:64
reg export "HKCU\Software\Microsoft\Windows\CurrentVersion\ThemeManager" "C:\fleitasarts\1.BestPerf.HKCUThemeManager.BAK.reg" /y /reg:64
reg export "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ThemeManager" "C:\fleitasarts\1.BestPerf.HKLMThemeManager.BAK.reg" /y /reg:64

echo "Importing 1.BestPerformance.reg"
regedit /s 1.BestPerformance.reg
echo "Imported 1.BestPerformance.reg"

@Echo off
echo "Restart Themes/Temas Service ..."

net stop themes
net start themes

The script above helps tremendously when having to RDP over super-high latency networks (satellite) that have 2000+ ms (milliseconds) latency on a good day.

This is the setting I’m referring to, but via cmd line its much faster to do as keyboard input is faster than waiting for the mouse plus everything else to arrive/render across the network.


Now note, yes, if I recall correctly, this is specific to the user profile so I recommend doing this for the SQL Service profile and/or your own profile too if needed. Simply login once as that account and run the 1st file with the 3 files (contents) in the same folder.


Okay now for the more popular setting – Power Option High performance. In case you haven’t heard of it, the impact of leaving this to the default Balanced plan, is that it will throttle your CPU power consumption frequency down when the OS thinks its okay and that’s not okay for SQL Server. If you want to witness it for yourself just open Resource Monitor and under the CPU tab, keep an eye on % Maximum Frequency. While in Balanced plan you will see it drop under 100% quite often.

powercfg -s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
powercfg -l

This is the equivalent of selecting the plan like this.HighPerformance

The Output.txt will look like this.



  1. Microsoft Technet Social Forum: Ajust for best performance
  2. powercfg-command-line-options

Okay so that was a lot of syntax, screenshots and verbiage. I hope I didn’t loose anyone. Did it help?



Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.