-
Notifications
You must be signed in to change notification settings - Fork 15
/
EchoX.bat
1871 lines (1676 loc) · 106 KB
/
EchoX.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
::https://tinyurl.com/echoxlicense
@echo off
Mode 52,16
title EchoX
set Version=9.6
set DevBuild=No
cd %tmp%
::Begin Log
set error="%tmp%\EchoXError.txt"
set log="%tmp%\EchoXLog.txt"
echo log_started >%log% 2>%error%
::Enable Delayed Expansion
setlocal EnableDelayedExpansion
::Enable ANSI escape sequences
for /f "tokens=3" %%a in ('Reg query HKCU\CONSOLE /v VirtualTerminalLevel 2^>nul') do set /a "ANSI=%%a"
if "%ANSI%" neq "1" (
Reg add HKCU\CONSOLE /v VirtualTerminalLevel /t REG_DWORD /d 1 /f
start "" "%~s0"
exit /b
)
::Choice Prompt Setup
for /f %%A in ('"prompt $H &echo on &for %%B in (1) do rem"') do set BS=%%A
:DarkMode
for /f "tokens=3 skip=2" %%a in ('Reg query "HKCU\Software\EchoX" /v DarkMode 2^>nul') do set /a "DarkMode=%%a"
if "%DarkMode%" equ "1" (
::Text Color Red
set col1=[91m
::Highlight Color Blue
set col2=[94m
color fc
) else (
::Text Color White
set col1=[97m
::Highlight Color Red
set col2=[31m
color f
)
if "%~1" equ "change" goto:eof
::Check For PowerShell
if not exist "%windir%\system32\WindowsPowerShell\v1.0\powershell.exe" (
call:EchoXLogo
echo.
echo %BS% Missing PowerShell 1.0
echo %BS% press C to continue anyway
choice /c:"CQ" /n /m "%BS% [C] Continue [Q] Quit" & if !errorlevel! equ 2 exit /b
)
::Get Admin Rights
rmdir %SystemDrive%\Windows\system32\adminrightstest >nul 2>&1
mkdir %SystemDrive%\Windows\system32\adminrightstest >nul 2>&1
if %errorlevel% neq 0 (
call:EchoXLogo
echo %col2%Run EchoX as Admin%col1%
powershell -NoProfile -NonInteractive -Command start -verb runas "'%~s0'" >nul 2>&1
if !errorlevel! equ 0 exit /b
call:EchoXLogo
echo.
echo %col2%EchoX is not running as Admin!
echo Some optimizations won't work. Continue anyway?%col1%
echo.
choice /c:"CQ" /n /m "%BS% [C] Continue [Q] Quit" & if !errorlevel! equ 2 exit /b
)
::Check For Internet
Ping www.google.nl -n 1 -w 1000 >nul
if %errorlevel% neq 0 (
call:EchoXLogo
echo.
echo %BS% No Internet Connection
echo %BS% press C to continue anyway
choice /c:"CQ" /n /m "%BS% [C] Continue [Q] Quit" & if !errorlevel! equ 2 exit /b
)
::Run CMD in 32-Bit
set SystemPath=%SystemRoot%\System32
if not "%ProgramFiles(x86)%"=="" (if exist %SystemRoot%\Sysnative\* set SystemPath=%SystemRoot%\Sysnative)
if "%processor_architecture%" neq "AMD64" (start "" /I "%SystemPath%\cmd.exe" /c "%~s0" & exit /b)
::Check For Updates
curl -g -k -L -# -o "%tmp%\latestVersion.bat" "https://raw.githubusercontent.com/UnLovedCookie/EchoX/main/Files/Version" >nul 2>&1
call "%tmp%\latestVersion.bat"
if "%DevBuild%" neq "Yes" if "%Version%" lss "!latestVersion!" (cls
call:EchoXLogo
echo.
echo Warning, EchoX isn't updated.
echo Would you like to update to version %col2%!latestVersion!?
echo.
choice /c:"YN" /n /m "%BS% [Y] Yes [N] No"
if !errorlevel! equ 1 (
curl -L -o "%~s0" "https://github.com/UnLovedCookie/EchoX/releases/latest/download/EchoX.bat" >nul 2>&1
call "%~s0"
)
)
::Settings
call:EchoXLogo
echo %col2%Loading Settings [...]%col1%
::Nvidia Driver
set cdCache=%cd%
cd "%SystemDrive%\Program Files\NVIDIA Corporation\NVSMI\" >nul 2>&1
for /f "tokens=1" %%a in ('nvidia-smi --query-gpu^=driver_version --format^=csv 2^>nul') do set NvidiaDriverVersion=%%a
cd %cdCache%
if not exist "%SystemRoot%\System32\wbem\WMIC.exe" (
::WMI Settings
Reg add "HKCU\Software\EchoX" /f >nul 2>&1
powershell -ExecutionPolicy Unrestricted -NoProfile import-module Microsoft.PowerShell.Management;import-module Microsoft.PowerShell.Utility;^
$GPU = Get-WmiObject win32_VideoController ^| Select-Object -ExpandProperty Name;Set-ItemProperty -Path "HKCU:\Software\Echo" -Name "GPU_NAME" -Type String -Value "$GPU";^
$mem = Get-WmiObject win32_operatingsystem ^| Select-Object -ExpandProperty TotalVisibleMemorySize;Set-ItemProperty -Path "HKCU:\Software\Echo" -Name "mem" -Type String -Value "$mem";^
$ChassisTypes = Get-WmiObject win32_SystemEnclosure ^| Select-Object -ExpandProperty ChassisTypes;Set-ItemProperty -Path "HKCU:\Software\Echo" -Name "ChassisTypes" -Type String -Value "$ChassisTypes";^
$Degrees = Get-WmiObject -Namespace "root/wmi" MSAcpi_ThermalZoneTemperature ^| Select-Object -ExpandProperty CurrentTemperature;Set-ItemProperty -Path "HKCU:\Software\Echo" -Name "Degrees" -Type String -Value "$Degrees";^
$CORES = Get-WmiObject win32_processor ^| Select-Object -ExpandProperty NumberOfCores;Set-ItemProperty -Path "HKCU:\Software\Echo" -Name "CORES" -Type String -Value "$CORES";^
$osarchitecture = Get-WmiObject win32_operatingsystem ^| Select-Object -ExpandProperty osarchitecture;Set-ItemProperty -Path "HKCU:\Software\Echo" -Name "osarchitecture" -Type String -Value "$osarchitecture"
for /f "tokens=3 skip=2" %%a in ('Reg query "HKCU\Software\EchoX" /v CORES') do set CORES=%%a
for /f "tokens=*" %%a in ('Reg query "HKCU\Software\EchoX" /v GPU_NAME') do set GPU_NAME=%%a
for /f "tokens=3 skip=2" %%a in ('Reg query "HKCU\Software\EchoX" /v mem') do set mem=%%a
for /f "tokens=3 skip=2" %%a in ('Reg query "HKCU\Software\EchoX" /v ChassisTypes') do set ChassisTypes=%%a
for /f "tokens=3 skip=2" %%a in ('Reg query "HKCU\Software\EchoX" /v Degrees') do set Degrees=%%a
for /f "tokens=3 skip=2" %%a in ('Reg query "HKCU\Software\EchoX" /v osarchitecture') do set osarchitecture=%%a
) >nul 2>&1 else (
::Faster WMIC Settings
rem for /f "tokens=2 delims==" %%n in ('wmic /namespace:\\root\wmi path MSAcpi_ThermalZoneTemperature get CurrentTemperature /value') do set Degrees=%%n
rem for /f "delims=" %%n in ('"wmic path Win32_VideoController get CurrentHorizontalResolution,CurrentVerticalResolution /format:value"') do set "%%n" >nul 2>&1
for /f "tokens=2 delims==" %%n in ('wmic os get TotalVisibleMemorySize /format:value') do set ram=%%n
for /f "tokens=2 delims==" %%n in ('wmic path Win32_VideoController get Name /format:value') do set GPU_NAME=%%n
for /f "tokens=2 delims==" %%n in ('wmic cpu get numberOfCores /format:value') do set CORES=%%n
for /f "tokens=2 delims={}" %%n in ('wmic path Win32_SystemEnclosure get ChassisTypes /format:value') do set /a ChassisTypes=%%n
wmic logicaldisk where "DriveType='3' and DeviceID='%systemdrive%'" get DeviceID 2>&1 | find "%systemdrive%" >nul && set "storageType=SSD" || set "storageType=HDD"
) >nul 2>&1
::NSudo
if not exist "%tmp%\NSudo.exe" (
echo Downloading NSudo [...]
curl -g -k -L -# -o "%tmp%\NSudo.exe" "https://github.com/UnLovedCookie/EchoX/raw/main/Files/NSudo.exe" >nul 2>&1
)
::Setup NSudo
rmdir %SystemDrive%\Windows\system32\adminrightstest >nul 2>&1
mkdir %SystemDrive%\Windows\system32\adminrightstest >nul 2>&1
if %errorlevel% neq 0 (
Start "" /D "%tmp%" NSudo.exe -U:S -ShowWindowMode:Hide cmd /c "Reg add "HKLM\SYSTEM\CurrentControlSet\Services\TrustedInstaller" /v "Start" /t REG_DWORD /d "3" /f"
Start "" /D "%tmp%" NSudo.exe -U:S -ShowWindowMode:Hide cmd /c "sc start "TrustedInstaller"
)
::Extra Settings
set DualBoot=Unknown
set CPU_NAME=%PROCESSOR_IDENTIFIER%
set THREADS=%NUMBER_OF_PROCESSORS%
::Nvidia Drivers
if 1 neq 1 if "%NvidiaDriverVersion%" neq "457.30" (
call:EchoXLogo
echo.
echo Recommended graphics driver not found:
choice /c:12 /n /m "%BS% [1] Install [2] Skip"
if !errorlevel!==1 (
cls & echo Downloading Nvidia Driver [...]
if exist "%tmp%\457.30x64Desktop.exe" del "%tmp%\457.30x64Desktop.exe"
Reg query "HKLM\SYSTEM\CurrentControlSet\Services\nvlddmkm" /v "DCHUVen" >nul 2>&1
if !errorlevel! equ 0 (
curl -g -k -L -# -o "%tmp%\457.30x64Desktop.exe" "https://onedrive.live.com/download?cid=91FD8D99AB112B7E&resid=91FD8D99AB112B7E%%21108&authkey=AHcg0GQ-iB6_-AM" >nul 2>&1
) else (
curl -g -k -L -# -o "%tmp%\457.30x64Desktop.exe" "https://onedrive.live.com/download?cid=91FD8D99AB112B7E&resid=91FD8D99AB112B7E%%21106&authkey=AOw9OffeXfkCw8w" >nul 2>&1
)
echo Installing Nvidia Driver [...]
"%tmp%\457.30x64Desktop.exe"
if !errorlevel! neq 0 (cls & echo Failed to install Nvidia Drivers [...] & echo You'll have to manually install Nvidia Driver 457.30) else (cls & echo Installed Nvidia Drivers [...])
choice /c:"CQ" /n /m "%BS% [C] Continue [Q] Quit" & if !errorlevel! equ 2 exit /b
)
)
::Ask about Restore Points
for /f "tokens=3 skip=2" %%a in ('Reg query HKCU\Software\EchoX /v Restore 2^>nul') do set Restore=%%a
if "%Restore%" equ "" (cls
call:EchoXLogo
echo.
echo Let EchoX create a Restore Point
echo (Used to undo all changes^)
choice /c:NY /n /m "%BS% [Y] Yes [N] No"
Reg add "HKCU\Software\EchoX" /v Restore /t REG_DWORD /d "!errorlevel!" /f >nul
)
::New program
for /f "tokens=3 skip=2" %%a in ('Reg query HKCU\Software\EchoX /v NewSoftware 2^>nul') do set /a NewSoftware=%%a
if "%NewSoftware%" neq "2" (cls
Reg delete "HKCU\Software\EchoX" /v "NewSoftware" /f >nul 2>&1
echo.
echo.
echo.
echo EchoX is %col2%no longer receiving updates%col1%^^!
echo.
echo.
echo EchoX has been replaced by %col2%CoutX%col1% which will
echo recieve the latest performance and
echo stability updates.
echo.
echo.
echo Would you like to install CoutX now?
choice /c:YN /n /m "%BS% [Y] Yes [N] No"
if !errorlevel! equ 1 (
cd %~dp0
curl -L -o "CoutX-Setup.exe" "https://github.com/UnLovedCookie/CoutX/releases/latest/download/CoutX-Setup.exe" >nul 2>&1
start CoutX-Setup.exe
exit 0
)
if !errorlevel! equ 2 (
call:EchoXLogo
echo.
echo Do you want EchoX to remind you to download
echo CoutX every launch?
choice /c:YN /n /m "%BS% [Y] Yes [N] No"
if !errorlevel! equ 2 Reg add "HKCU\Software\EchoX" /v NewSoftware /t REG_DWORD /d "2" /f >nul
)
)
::Slider
for /f "tokens=3 skip=2" %%a in ('Reg query HKCU\Software\EchoX /v opt 2^>nul') do set /a opt=%%a
if "%opt%" equ "" call:Slider "%col1%Press %col2%C%col1% to continue%col1%"
::Check For 64-Bit
if "%PROCESSOR_ARCHITECTURE%" equ "x86" (cls
call:EchoXLogo
echo.
echo %BS% 64-bit Not Detected
echo %BS% press any key to continue anyway
choice /c:"CQ" /n /m "%BS% [C] Continue [Q] Quit" & if !errorlevel! equ 2 exit /b
)
::Auto Detect Settings
if defined ChassisTypes if %ChassisTypes% GEQ 8 if %ChassisTypes% LSS 12 (
for /f "tokens=3 skip=2" %%a in ('Reg query "HKCU\Software\EchoX" /v Throttling 2^>nul') do set "Throttling=%%a"
if "!Throttling!" equ "" Reg add "HKCU\Software\EchoX" /v Throttling /t REG_DWORD /d "0" /f >nul
) else (
for /f "tokens=3 skip=2" %%a in ('Reg query "HKCU\Software\EchoX" /v PowMax 2^>nul') do set "PowMax=%%a"
if "!PowMax!" equ "" Reg add "HKCU\Software\EchoX" /v PowMax /t REG_DWORD /d "1" /f >nul
)
for /f "tokens=3 skip=2" %%a in ('Reg query "HKCU\Software\EchoX" /v NVCP 2^>nul') do set "NVCP=%%a"
for %%a in (391.35 425.31 441.XX 461.72 456.71 457.30 461.72 461.92 466.11) do (
if not defined NVCP if "%NvidiaDriverVersion%" equ "%%a" Reg add "HKCU\Software\EchoX" /v NVCP /t REG_DWORD /d "1" /f >nul
)
if /i "%~1"=="/optimize" goto optimize
:Home
Mode 52,16
cls
echo.
echo %col1%Speed up %col2%performance%col1%, %col2%latency%col1%, and %col2%ping%col1%
echo %BS% %col1%______ _____ ___ ___ _______ %col2%___ ___%col1%
echo %BS% ^|\ __\ ___\ \\ \\ _ \ %col2%^|\ \ / /^|%col1%
echo %BS% \ \ \__\ \__^|\ \\ \\ \\ \ %col2%\ \ \ / /%col1%
echo %BS% \ \ __\ \ \ _ \\ \\ \ %col2%\ \ / /%col1%
echo %BS% \ \ \__\ \___\ \\ \\ \\ \%col2% \/ \/%col1%
echo %BS% \ \_____\______\ \\__\\______\%col2%/ \ \%col1%
echo %BS% \^|_____^|______^|__^|^|__^|^|______%col2%/__/ \__\%col1%
echo %BS% %col2%^[__^|\^|__]%col1%
echo %col1%[%col2%1%col1%] Optimize [%col2%2%col1%] More
echo [%col2%3%col1%] Undo [%col2%4%col1%] Credits [%col2%5%col1%] Presets
echo [%col2%G%col1%] Game-Booster%col2%
echo.
::choice /c:12345G /n /m "%BS% [%col2%G%col1%] Game-Booster%col2% >:"
::choice /c:12345G /n /m "%BS% >:"
::choice /c:12345G /n /m "%BS% %col1%[%col2%Press the corresponding number%col1%]%col2% >:"
::choice /c:12345G /n /m "%BS% %col1%Version %col2%%Version% %col2%>:"
::choice /c:12345G /n /m "%BS% %col2%>: %col1%Version %col2%%Version%"
choice /c:12345G /n /m "%BS% %col1%[%col2%Press a corresponding number%col1%]%col2% %col1%Version %col2%%Version%"
set MenuItem=%errorlevel%
if "%MenuItem%"=="1" goto Optimize
if "%MenuItem%"=="2" set "SettingsPage=1" & goto Settings
if "%MenuItem%"=="3" goto Undo
if "%MenuItem%"=="4" goto Credits
if "%MenuItem%"=="5" call :Slider " %col2%Press B for back%col1%" & goto Home
if "%MenuItem%"=="6" goto gamebooster
:Settings
set SettingsItem=Undefined
cls
if "%SettingsPage%"=="1" (
for %%i in (Idle sleepstates PowMax Throttling) do set %%i=[91moff & for /f "tokens=3 skip=2" %%a in ('Reg query HKCU\Software\EchoX /v %%i 2^>nul') do if "%%a"=="0x1" set %%i=[32mon
echo.
echo %col2%Page 1/4
echo %col1%[%col2%1%col1%] Disable CPU C-States !Idle!
echo [90mIncreases performance and CPU temperature
echo.
echo %col1%[%col2%2%col1%] Disable CPU Sleep States !sleepstates!
echo [90mThis will disable sleep and hibernation
echo.
echo %col1%[%col2%3%col1%] Disable Core Parking !PowMax!
echo [90mIncreases performance and CPU temperature
echo.
echo %col1%[%col2%4%col1%] Disable Power-Throttling !Throttling!
echo [90mIncreases performance and temperature%col1%
echo.
choice /c:1234NB /n /m "%BS% [N] Next [B] Back"
set /a SettingsItem=!errorlevel!
if "!SettingsItem!"=="5" (set SettingsPage=2)
cls
)
if %SettingsItem% equ 1 if "%Idle%"=="[32mon" (Reg add "HKCU\Software\EchoX" /v Idle /t REG_DWORD /d "0" /f >nul) else (Reg add "HKCU\Software\EchoX" /v Idle /t REG_DWORD /d "1" /f >nul)
if %SettingsItem% equ 2 if "%sleepstates%"=="[32mon" (Reg add "HKCU\Software\EchoX" /v sleepstates /t REG_DWORD /d "0" /f >nul) else (Reg add "HKCU\Software\EchoX" /v sleepstates /t REG_DWORD /d "1" /f >nul)
if %SettingsItem% equ 3 if "%PowMax%"=="[32mon" (Reg add "HKCU\Software\EchoX" /v PowMax /t REG_DWORD /d "0" /f >nul) else (Reg add "HKCU\Software\EchoX" /v PowMax /t REG_DWORD /d "1" /f >nul)
if %SettingsItem% equ 4 if "%Throttling%"=="[32mon" (Reg add "HKCU\Software\EchoX" /v Throttling /t REG_DWORD /d "0" /f >nul) else (Reg add "HKCU\Software\EchoX" /v Throttling /t REG_DWORD /d "1" /f >nul)
if %SettingsItem% lss 5 goto Settings
if "%SettingsPage%"=="2" (
for %%i in (cstates pstates KBoost NVCP) do set %%i=[91moff & for /f "tokens=3 skip=2" %%a in ('Reg query HKCU\Software\EchoX /v %%i 2^>nul') do if "%%a"=="0x1" set %%i=[32mon
echo.
echo %col2%Page 2/4
echo %col1%[%col2%1%col1%] Disable iGPU C-States !cstates!
echo [90mIncreases performance and iGPU temperature
echo.
echo %col1%[%col2%2%col1%] Disable GPU P-States !pstates!
echo [90mIncreases performance and GPU temperature
echo.
echo %col1%[%col2%3%col1%] KBoost !KBoost!
echo [90mIncreases performance and GPU temperature
echo.
echo %col1%[%col2%4%col1%] NVCP Settings !NVCP!
echo [90mIncreases performance and GPU temperature%col1%
echo.
choice /c:1234NB /n /m "%BS% [N] Next [B] Back"
set SettingsItem=!errorlevel!
if "!SettingsItem!"=="5" (set SettingsPage=3)
cls
)
if %SettingsItem% equ 1 if "%cstates%"=="[32mon" (Reg add "HKCU\Software\EchoX" /v cstates /t REG_DWORD /d "0" /f >nul) else (Reg add "HKCU\Software\EchoX" /v cstates /t REG_DWORD /d "1" /f >nul)
if %SettingsItem% equ 2 if "%pstates%"=="[32mon" (Reg add "HKCU\Software\EchoX" /v pstates /t REG_DWORD /d "0" /f >nul) else (Reg add "HKCU\Software\EchoX" /v pstates /t REG_DWORD /d "1" /f >nul)
if %SettingsItem% equ 3 if "%KBoost%"=="[32mon" (Reg add "HKCU\Software\EchoX" /v KBoost /t REG_DWORD /d "0" /f >nul) else (Reg add "HKCU\Software\EchoX" /v KBoost /t REG_DWORD /d "1" /f >nul)
if %SettingsItem% equ 4 if "%NVCP%"=="[32mon" (Reg add "HKCU\Software\EchoX" /v NVCP /t REG_DWORD /d "0" /f >nul) else (Reg add "HKCU\Software\EchoX" /v NVCP /t REG_DWORD /d "1" /f >nul)
if %SettingsItem% lss 5 goto Settings
if "%SettingsPage%"=="3" (
for %%i in (Res DSCP staticip Mouse) do set %%i=[91moff & for /f "tokens=3 skip=2" %%a in ('Reg query HKCU\Software\EchoX /v %%i 2^>nul') do if "%%a"=="0x1" set %%i=[32mon
echo.
echo %col2%Page 3/4
echo %col1%[%col2%1%col1%] Static IP !staticip!
echo [90mTurn this on to enable Static IP
echo.
echo %col1%[%col2%2%col1%] DSCP Value !DSCP!
echo [90mTurn this on to prioritize your packets%col1%
echo.
echo %col1%[%col2%3%col1%] Timer Resolution !Res!
echo [90mTurn this on for older games
echo.
echo %col1%[%col2%4%col1%] Mouse Optimization !Mouse!
echo [90mTurn this off if you use a trackpad%col1%
echo.
choice /c:1234NB /n /m "%BS% [N] Next [B] Back"
set SettingsItem=!errorlevel!
if "!SettingsItem!"=="5" (set SettingsPage=4)
cls
)
if %SettingsItem% equ 1 if "%staticip%"=="[32mon" (Reg add "HKCU\Software\EchoX" /v staticip /t REG_DWORD /d "0" /f >nul) else (Reg add "HKCU\Software\EchoX" /v staticip /t REG_DWORD /d "1" /f >nul)
if %SettingsItem% equ 2 if "%DSCP%"=="[32mon" (Reg add "HKCU\Software\EchoX" /v DSCP /t REG_DWORD /d "0" /f >nul) else (Reg add "HKCU\Software\EchoX" /v DSCP /t REG_DWORD /d "1" /f >nul)
if %SettingsItem% equ 3 if "%Res%"=="[32mon" (Reg add "HKCU\Software\EchoX" /v Res /t REG_DWORD /d "0" /f >nul) else (Reg add "HKCU\Software\EchoX" /v Res /t REG_DWORD /d "1" /f >nul)
if %SettingsItem% equ 4 if "%Mouse%"=="[32mon" (Reg add "HKCU\Software\EchoX" /v Mouse /t REG_DWORD /d "0" /f >nul) else (Reg add "HKCU\Software\EchoX" /v Mouse /t REG_DWORD /d "1" /f >nul)
if %SettingsItem% equ 5 goto Settings
if %SettingsItem% lss 5 goto Settings
if "%SettingsPage%"=="4" (
for %%i in (DarkMode Restore DisplayScaling honepow) do set %%i=[91moff & for /f "tokens=3 skip=2" %%a in ('Reg query HKCU\Software\EchoX /v %%i 2^>nul') do if "%%a"=="0x1" set %%i=[32mon
echo.
echo %col2%Page 4/4
echo %col1%[%col2%1%col1%] EchoX Light Mode !DarkMode!
echo [90mSwitch the EchoX GUI into light mode
echo.
echo %col1%[%col2%2%col1%] Don't Create A Restore Point !Restore!
echo [90mNot recommended to turn this off
echo.
echo %col1%[%col2%3%col1%] Disable Display Scaling !DisplayScaling!
echo [90mTurn this on to disable display scaling
echo.
echo %col1%[%col2%4%col1%] Hone Power Plan !honepow!
echo [90mAn alternative power plan that might be better%col1%
echo.
choice /c:1234NB /n /m "%BS% [N] Next [B] Back"
set SettingsItem=!errorlevel!
if "!SettingsItem!"=="5" (set SettingsPage=1)
cls
)
if %SettingsItem% equ 1 if "%DarkMode%"=="[32mon" (Reg add "HKCU\Software\EchoX" /v DarkMode /t REG_DWORD /d "0" /f >nul) else (Reg add "HKCU\Software\EchoX" /v DarkMode /t REG_DWORD /d "1" /f >nul)
if %SettingsItem% equ 1 call :DarkMode "change"
if %SettingsItem% equ 2 if "%Restore%"=="[32mon" (Reg add "HKCU\Software\EchoX" /v Restore /t REG_DWORD /d "0" /f >nul) else (Reg add "HKCU\Software\EchoX" /v Restore /t REG_DWORD /d "1" /f >nul)
if %SettingsItem% equ 3 if "%DisplayScaling%"=="[32mon" (Reg add "HKCU\Software\EchoX" /v DisplayScaling /t REG_DWORD /d "0" /f >nul) else (Reg add "HKCU\Software\EchoX" /v DisplayScaling /t REG_DWORD /d "1" /f >nul)
if %SettingsItem% equ 4 if "%honepow%"=="[32mon" (Reg add "HKCU\Software\EchoX" /v honepow /t REG_DWORD /d "0" /f >nul) else (Reg add "HKCU\Software\EchoX" /v honepow /t REG_DWORD /d "1" /f >nul)
if %SettingsItem% leq 5 goto Settings
goto home
:Optimize
call:GrabSettings
if "%NVCP%"=="0x1" (
echo Downloading NVCP Settings [...]
if not exist "%tmp%\nvidiaProfileInspector.zip" curl -g -k -L -# -o "%tmp%\nvidiaProfileInspector.zip" "https://github.com/Orbmu2k/nvidiaProfileInspector/releases/latest/download/nvidiaProfileInspector.zip"
if not exist "%tmp%\nvidiaProfileInspector" powershell -NoProfile Expand-Archive '%tmp%\nvidiaProfileInspector.zip' -DestinationPath '%tmp%\nvidiaProfileInspector\'
curl -g -k -L -# -o "%tmp%\nvidiaProfileInspector\EchoProfile.nip" "https://raw.githubusercontent.com/UnLovedCookie/EchoX/main/Files/EchoProfile.nip"
)
if "%Res%"=="0x1" if not exist "%SystemDrive%\EchoRes.exe" (
echo Downloading Timer Resolution [...]
curl -g -k -L -# -o "%SystemDrive%\EchoRes.exe" "https://github.com/UnLovedCookie/EchoX/raw/main/Files/SetTimerResolutionService.exe" >nul 2>&1
)
::Restore Point
if not "%Restore%"=="0x1" (cls
echo Creating System Restore Point [...]
Reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\SystemRestore" /v "SystemRestorePointCreationFrequency" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
powershell -ExecutionPolicy Bypass -Command "Checkpoint-Computer -Description 'Echo Optimization' -RestorePointType 'MODIFY_SETTINGS'"
if !errorlevel! neq 0 cls & echo Failed to create a restore point! & echo. & echo Press any key to continue anyway & pause >nul
)
::Registry Backup
rmdir %SystemDrive%\Windows\system32\adminrightstest >nul 2>&1
mkdir %SystemDrive%\Windows\system32\adminrightstest >nul 2>&1
if %errorlevel% equ 0 if not exist "%SystemDrive%\regbackup.reg" (
call:EchoXLogo
echo.
echo %BS% Creating Registry Backup [...]
Regedit /e "%SystemDrive%\regbackup.reg" >>%log% 2>>%error%
if !errorlevel! neq 0 cls & echo Failed to create a registry backup! & echo. & echo Press any key to continue anyway & pause >nul
)
::BCD Backup
if not exist "%SystemDrive%\bcdbackup.bcd" (
call:EchoXLogo
echo.
echo %BS% Creating BCD Edit Backup [...]
bcdedit /export "%SystemDrive%\bcdbackup.bcd" >>%log% 2>>%error%
)
::Fix System Files
rem sfc /scannow
rem Dism /Online /Cleanup-Image /RestoreHealth
::Optimize Drives
rem defrag /C /O
cls
::::::::::::::::::::::
::Win Optimizations::
::::::::::::::::::::::
title Win Optimizations
echo [32mWin Optimizations%col1%
::Powershell
start "" /MIN powershell -NoProfile -NonInteractive -Command ^
$ErrorActionPreference = 'SilentlyContinue';^
Disable-MMAgent -mc -PageCombining;^
Enable-NetAdapterQos -Name "*";^
Disable-NetAdapterPowerManagement -Name "*";^
Get-NetAdapter -IncludeHidden ^| Set-NetIPInterface -WeakHostSend Enabled -WeakHostReceive Enabled;^
Set-NetOffloadGlobalSetting -PacketCoalescingFilter Disabled -Chimney Disabled;^
Set-NetTCPSetting -SettingName "*" -MemoryPressureProtection Disabled -InitialCongestionWindow 10
echo Disable Page Combining and Memory Compression
echo Disable Network Adapter Power Savings
echo Remove network security mitigations
echo TCPIP Settings
::Animations
Reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" /v "VisualFXSetting" /t REG_DWORD /d "3" /f >>%log% 2>>%error%
Reg add "HKCU\Control Panel\Desktop" /f /v "UserPreferencesMask" /t REG_BINARY /d "9012078012000000" >>%log% 2>>%error%
Reg add "HKCU\Control Panel\Desktop" /v "DragFullWindows" /t REG_SZ /d "1" /f >>%log% 2>>%error%
Reg add "HKCU\Control Panel\Desktop" /v "FontSmoothing" /t REG_SZ /d "2" /f >>%log% 2>>%error%
Reg add "HKCU\Control Panel\Desktop\WindowMetrics" /v "MinAnimate" /t REG_SZ /d "0" /f >>%log% 2>>%error%
Reg add "HKCU\Software\Microsoft\Windows\DWM" /v "EnableAeroPeek" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKCU\Software\Microsoft\Windows\DWM" /v "AlwaysHibernateThumbnails" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKCU\Software\Microsoft\Windows\DWM" /v "ListviewShadow" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "IconsOnly" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ListviewAlphaSelect" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarAnimations" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ListviewShadow" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Animations
::Pause Maps Updates/Downloads
Reg add "HKLM\Software\Policies\Microsoft\Windows\Maps" /v "AutoDownloadAndUpdateMapData" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows\Maps" /v "AllowUntriggeredNetworkTrafficOnSettingsPage" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
::Disable Settings Sync
Reg add "HKLM\Software\Policies\Microsoft\Windows\SettingSync" /v "DisableSettingSync" /t REG_DWORD /d "2" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows\SettingSync" /v "DisableSettingSyncUserOverride" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows\SettingSync" /v "DisableSyncOnPaidNetwork" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
::Location Tracking
Reg add "HKLM\Software\Policies\Microsoft\FindMyDevice" /v "AllowFindMyDevice" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
rem Reg add "HKLM\Software\Policies\Microsoft\FindMyDevice" /v "LocationSyncEnabled" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
::Disable Web in Search
Reg add "HKLM\Software\Policies\Microsoft\Windows\Windows Search" /v "ConnectedSearchUseWeb" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows\Windows Search" /v "DisableWebSearch" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Search" /v "BingSearchEnabled" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
::Disable Remote Assistance
Reg add "HKLM\System\CurrentControlSet\Control\Remote Assistance" /v "fAllowFullControl" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKLM\System\CurrentControlSet\Control\Remote Assistance" /v "fAllowToGetHelp" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKLM\System\CurrentControlSet\Control\Remote Assistance" /v "fEnableChatControl" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Windows Settings
::Disable Desktop Composition (on win 7)
Reg add "HKCU\Software\Microsoft\Windows\DWM" /v "Composition" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Disable Desktop Composition
::Dsable Full Screen Optimizations and Game Bar
Reg add "HKCU\System\GameConfigStore" /v "GameDVR_Enabled" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\GameDVR" /v "AppCaptureEnabled" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKCU\System\GameConfigStore" /v "GameDVR_FSEBehavior" /t REG_DWORD /d "2" /f >>%log% 2>>%error%
Reg add "HKCU\System\GameConfigStore" /v "GameDVR_FSEBehaviorMode" /t REG_DWORD /d "2" /f >>%log% 2>>%error%
Reg add "HKCU\System\GameConfigStore" /v "GameDVR_HonorUserFSEBehaviorMode" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "HKCU\System\GameConfigStore" /v "GameDVR_DXGIHonorFSEWindowsCompatible" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "HKCU\System\GameConfigStore" /v "GameDVR_EFSEFeatureFlags" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Disabled FSO
::System responsiveness, PanTeR Said to use 14 (20 hexa)
Reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v "SystemResponsiveness" /t REG_DWORD /d "20" /f >>%log% 2>>%error%
echo System Responsivness
::Wallpaper quality 100%
Reg add "HKCU\Control Panel\Desktop" /v "JPEGImportQuality" /t REG_DWORD /d "100" /f >>%log% 2>>%error%
echo Wallpaper Quality
::Wait time to kill app during shutdown
Reg add "HKCU\Control Panel\Desktop" /v "WaitToKillAppTimeout" /t REG_SZ /d "1000" /f >>%log% 2>>%error%
::Wait to end service at shutdown
Reg add "HKLM\System\CurrentControlSet\Control" /v "WaitToKillServiceTimeout" /t REG_SZ /d "1000" /f >>%log% 2>>%error%
::Wait to kill non-responding app
Reg add "HKCU\Control Panel\Desktop" /v "HungAppTimeout" /t REG_SZ /d "1000" /f >>%log% 2>>%error%
echo Speedup app shutdown
::Unnecessary Files
del /s /f /q "%SystemDrive%\windows\history\*" >nul 2>&1
del /s /f /q "%SystemDrive%\windows\recent\*" >nul 2>&1
del /s /f /q "%SystemDrive%\windows\spool\printers\*" >nul 2>&1
del /s /f /q "%SystemDrive%\Windows\Prefetch\*" >nul 2>&1
echo Clean Drive
::::::::::::::::::::::
::Remove Mitigations::
::::::::::::::::::::::
cls
title Remove Mitigation
echo [32mRemove Mitigations%col1%
::Turn Core Isolation Memory Integrity OFF
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" /v "Enabled" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Turn Core Isolation Memory Integrity OFF
::Disable Process Mitigations
Reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\csrss.exe" /v MitigationAuditOptions /t Reg_BINARY /d "222222222222222222222222222222222222222222222222" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\csrss.exe" /v MitigationOptions /t Reg_BINARY /d "222222222222222222222222222222222222222222222222" /f >>%log% 2>>%error%
echo Disable Process Mitigations
::Disable TsX to mitigate ZombieLoad
Reg add "HKLM\System\CurrentControlSet\Control\Session Manager\kernel" /v "DisableTsx" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
echo Disable TsX to mitigate ZombieLoad
::Disable Dma Remapping
rem Takes too long, use registry method instead
rem for /f "tokens=1" %%i in ('driverquery') do Reg add "HKLM\System\CurrentControlSet\Services\%%i\Parameters" /v "DmaRemappingCompatible" /t REG_DWORD /d "0" /f >nul 2>&1
Reg add "HKLM\Software\Microsoft\PolicyManager\default\DmaGuard\DeviceEnumerationPolicy" /v "value" /t REG_DWORD /d "2" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows\DeviceGuard" /v "HVCIMATRequired" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows\DeviceGuard" /v "EnableVirtualizationBasedSecurity" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Disable DmaRemapping
::Disable SEHOP
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel" /v "DisableExceptionChainValidation" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel" /v "KernelSEHOPEnabled" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Disable SEHOP
::Disable ASLR
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "MoveImages" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Disable ASLR
::Disable Spectre And Meltdown
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettings /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverride /t REG_DWORD /d "3" /f >>%log% 2>>%error%
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverrideMask /t REG_DWORD /d "3" /f >>%log% 2>>%error%
del /f /q "%WinDir%\System32\mcupdate_GenuineIntel.dll" >nul 2>&1
del /f /q "%WinDir%\System32\mcupdate_AuthenticAMD.dll" >nul 2>&1
echo Disable Spectre And Meltdown
::Disable CFG Lock
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "EnableCfg" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Disable CFG Lock
::Disable NTFS/ReFS and FS Mitigations
Reg add "HKLM\System\CurrentControlSet\Control\Session Manager" /v "ProtectionMode" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Disable NTFS/ReFS and FS Mitigations
::Disable Kernel Mitigations
for /f "tokens=3 skip=2" %%i in ('Reg query "HKLM\System\CurrentControlSet\Control\Session Manager\kernel" /v "MitigationAuditOptions"') do (
set "mitigation_mask=%%i"
for /l %%i in (0,1,9) do set mitigation_mask=!mitigation_mask:%%i=2!
)
Reg add "HKLM\System\CurrentControlSet\Control\Session Manager\kernel" /v "MitigationOptions" /t REG_BINARY /d "%mitigation_mask%" /f >nul
Reg add "HKLM\System\CurrentControlSet\Control\Session Manager\kernel" /v "MitigationAuditOptions" /t REG_BINARY /d "%mitigation_mask%" /f >nul
echo Disable Kernel Mitigations
::Slim Windows Defender and SmartScreen (From Melodies Windows 11 Optimizer)
::Start "" /wait "%tmp%\NSudo.exe" -U:T -P:E -M:S -ShowWindowMode:Hide cmd /c "sc config WinDefend start=disabled"
::Start "" /wait "%tmp%\NSudo.exe" -U:T -P:E -M:S -ShowWindowMode:Hide cmd /c "sc stop WinDefend"
::Start "" /wait "%tmp%\NSudo.exe" -U:T -P:E -M:S -ShowWindowMode:Hide cmd /c "sc config WinDefend start=auto"
::Start "" /wait "%tmp%\NSudo.exe" -U:T -P:E -M:S -ShowWindowMode:Hide cmd /c "sc start WinDefend"
Reg add "HKLM\Software\Policies\Microsoft\Windows\System" /v "EnableSmartScreen" /t REG_DWORD /d 0 /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\MicrosoftEdge\PhishingFilter" /v "EnabledV9" /t REG_DWORD /d 0 /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows Defender" /v "DisableRoutinelyTakingAction" /t REG_DWORD /d 1 /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /t REG_DWORD /d 1 /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows Defender" /v "ServiceKeepAlive" /t REG_DWORD /d 0 /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableRealtimeMonitoring" /t REG_DWORD /d 1 /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Reporting" /v "DisableEnhancedNotifications" /t REG_DWORD /d 1 /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows Defender\SmartScreen" /v "ConfigureAppInstallControlEnabled" /t REG_DWORD /d 0 /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Threats" /v "Threats_ThreatSeverityDefaultAction" /t REG_DWORD /d 1 /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Threats\ThreatSeverityDefaultAction" /v "1" /t REG_SZ /d "6" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Threats\ThreatSeverityDefaultAction" /v "2" /t REG_SZ /d "6" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Threats\ThreatSeverityDefaultAction" /v "4" /t REG_SZ /d "6" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Threats\ThreatSeverityDefaultAction" /v "5" /t REG_SZ /d "6" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows Defender\UX Configuration" /v "Notification_Suppress" /t REG_DWORD /d 1 /f >>%log% 2>>%error%
Reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\MsMpEng.exe\PerfOptions" /v "CpuPriorityClass" /t REG_DWORD /d 1 /f >>%log% 2>>%error%
Reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\MsMpEngCP.exe\PerfOptions" /v "CpuPriorityClass" /t REG_DWORD /d 1 /f >>%log% 2>>%error%
::Disable spynet Defender reporting
Reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Spynet" /v "SpynetReporting" /t REG_DWORD /d 0 /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Spynet" /v "LocalSettingOverrideSpynetReporting" /t REG_DWORD /d 0 /f >>%log% 2>>%error%
::Do not send malware samples for further analysis
Reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Spynet" /v "SubmitSamplesConsent" /t REG_DWORD /d "2" /f >>%log% 2>>%error%
::Disable watson malware reports
Reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Reporting" /v "DisableGenericReports" /t REG_DWORD /d "2" /f >>%log% 2>>%error%
::Disable malware diagnostic data
Reg add "HKLM\Software\Policies\Microsoft\MRT" /v "DontReportInfectionInformation" /t REG_DWORD /d "2" /f >>%log% 2>>%error%
echo Slim Windows Defender and SmartScreen
::Disable MS Edge Prelaunch
Reg add "HKLM\Software\Policies\Microsoft\MicrosoftEdge\Main" /v "AllowPrelaunch" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\MicrosoftEdge\TabPreloader" /v "AllowTabPreloading" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
::Disable MS Edge WebWidget
Reg add "HKLM\Software\Policies\Microsoft\Edge" /v WebWidgetAllowed /t REG_DWORD /d 0 /f >>%log% 2>>%error%
::MS Edge Settings
Reg add "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\Main" /v DoNotTrack /t REG_DWORD /d 1 /f >>%log% 2>>%error%
Reg add "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\User\Default\SearchScopes" /v ShowSearchSuggestionsGlobal /t REG_DWORD /d 0 /f >>%log% 2>>%error%
Reg add "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\FlipAhead" /v FPEnabled /t REG_DWORD /d 0 /f >>%log% 2>>%error%
Reg add "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\PhishingFilter" /v EnabledV9 /t REG_DWORD /d 0 /f >>%log% 2>>%error%
echo Slim MS Edge
::Turn off Inventory Collector
Reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /v "DisableInventory" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
::Turn off Windows Error Reporting
Reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting" /v "Disabled" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
::Disable Application Telemetry
Reg add "HKLM\Software\Policies\Microsoft\Windows\AppCompat" /v "AITEnable" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
::Disable the Customer Experience Improvement program (Below is 0 to disable)
Reg add "HKLM\SOFTWARE\Policies\Microsoft\Internet Explorer\SQM" /v "DisableCustomerImprovementProgram" /t REG_DWORD /d 0 /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\SQMClient\Windows" /v "CEIPEnable" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\AppV\CEIP" /v "CEIPEnable" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Messenger\Client" /v "CEIP" /t REG_DWORD /d "2" /f >>%log% 2>>%error%
::Disable Telemetry (Below is 1 to disable)
Reg add "HKLM\Software\Policies\Microsoft\MSDeploy\3" /v "EnableTelemetry" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "HKLM\System\CurrentControlSet\Services\DiagTrack" /v "Start" /t REG_DWORD /d "4" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
::Disable Text/Ink/Handwriting Telemetry
reg add "HKCU\Software\Microsoft\Input\TIPC" /v Enabled /t REG_DWORD /d 0 /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\InputPersonalization" /v "RestrictImplicitTextCollection" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\InputPersonalization" /v "RestrictImplicitInkCollection" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows\TabletPC" /v "PreventHandwritingDataSharing" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows\HandwritingErrorReports" /v "PreventHandwritingErrorReports" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "HKCU\Software\Microsoft\Personalization\Settings" /v AcceptedPrivacyPolicy /t REG_DWORD /d 0 /f >>%log% 2>>%error%
::Disable Advertising ID
Reg add "HKLM\Software\Policies\Microsoft\Windows\AdvertisingInfo" /v "DisabledByGroupPolicy" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v "Enabled" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Disable Telemetry
::Disable Biometrics
Reg add "HKLM\Software\Policies\Microsoft\Biometrics" /v "Enabled" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Disable Biometrics
::Security/Hardening
rem Restrict Enumeration of Anonymous SAM Accounts
rem https://www.stigviewer.com/stig/windows_10/2021-03-10/finding/V-220929
Reg add "HKLM\System\CurrentControlSet\Control\Lsa" /v "RestrictAnonymous" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
rem https://www.stigviewer.com/stig/windows_10/2021-03-10/finding/V-220930
Reg add "HKLM\System\CurrentControlSet\Control\Lsa" /v "RestrictAnonymousSAM" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
rem Disable NetBIOS, can be exploited and is highly vulnerable. (From Zeta)
sc config lmhosts start=disabled >nul 2>&1
sc stop lmhosts >nul 2>&1
rem NetBios is disabled. If it manages to become enabled, protect against NBT-NS poisoning attacks
Reg add "HKLM\System\CurrentControlSet\Services\NetBT\Parameters" /v "NodeType" /t REG_DWORD /d "2" /f >>%log% 2>>%error%
rem https://cyware.com/news/what-is-smb-vulnerability-and-how-it-was-exploited-to-launch-the-wannacry-ransomware-attack-c5a97c48
sc stop LanmanWorkstation >nul 2>&1
sc config LanmanWorkstation start=disabled >nul 2>&1
rem LanmanWorkstation is disabled. If it manages to become enabled, protect against other attacks
rem https://www.stigviewer.com/stig/windows_10/2021-03-10/finding/V-220932
Reg add "HKLM\System\CurrentControlSet\Services\LanManServer\Parameters" /v "RestrictNullSessAccess" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
rem Disable SMB Compression (Possible SMBGhost Vulnerability workaround)
Reg add "HKLM\System\CurrentControlSet\Services\LanManServer\Parameters" /v "DisableCompression" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
rem Harden lsass
Reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\lsass.exe" /v "AuditLevel" /t REG_DWORD /d "8" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows\CredentialsDelegation" /v "AllowProtectedCreds" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "HKLM\System\CurrentControlSet\Control\Lsa" /v "DisableRestrictedAdminOutboundCreds" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "HKLM\System\CurrentControlSet\Control\Lsa" /v "DisableRestrictedAdmin" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKLM\System\CurrentControlSet\Control\Lsa" /v "RunAsPPL" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "HKLM\System\CurrentControlSet\Control\SecurityProviders\WDigest" /v "Negotiate" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKLM\System\CurrentControlSet\Control\SecurityProviders\WDigest" /v "UseLogonCredential" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Security/Hardening
::::::::::::::::::::::
::RAM Optimizations::
::::::::::::::::::::::
cls
title RAM Optimizations
echo [32mRAM Optimizations%col1%
::Storage Optimizations + Ram
::Store Windows Kernel on Ram
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "DisablePagingExecutive" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
::Disable Page Combining
Reg add "HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management" /v "DisablePageCombining" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
echo Store Windows Kernel on Ram
::Set SvcSplitThreshold (revision)
set /a ram=%mem% + 1024000
Reg add "HKLM\System\CurrentControlSet\Control" /v "SvcHostSplitThresholdInKB" /t REG_DWORD /d "%ram%" /f >>%log% 2>>%error%
echo SvcSplitThreshold
::Disable Large System Cache
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "LargeSystemCache" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
echo Disable Large System Cache
if exist "%windir%\System32\fsutil.exe" (
::Raise the limit of paged pool memory
fsutil behavior set memoryusage 2
::https://www.serverbrain.org/solutions-2003/the-mft-zone-can-be-optimized.html
fsutil behavior set mftzone 2
::HDD + SSD
fsutil behavior set disabledeletenotify 0
fsutil behavior set encryptpagingfile 0
::https://ttcshelbyville.wordpress.com/2018/12/02/should-you-disable-8dot3-for-performance-and-security/
fsutil behavior set disable8dot3 1
Reg add "HKLM\System\CurrentControlSet\Control\FileSystem" /v "NtfsDisable8dot3NameCreation" /t REG_DWORD /d "1" /f
::Disable NTFS compression
fsutil behavior set disablecompression 1
::Disable Last Access information on directories, performance/privacy
::https://www.tenforums.com/tutorials/139015-enable-disable-ntfs-last-access-time-stamp-updates-windows-10-a.html
if "%storageType%" equ "SSD" (fsutil behavior set disableLastAccess 0
Reg add "HKLM\System\CurrentControlSet\Control\FileSystem" /v "NtfsDisableLastAccessUpdate" /t REG_DWORD /d "2147483648" /f)
if "%storageType%" equ "HDD" (fsutil behavior set disableLastAccess 1
Reg add "HKLM\System\CurrentControlSet\Control\FileSystem" /v "NtfsDisableLastAccessUpdate" /t REG_DWORD /d "2147483649" /f)
) >>%log% 2>>%error%
echo Optimized storage device %storageType%
::Disabling random drivers verification.
Reg add "HKLM\System\CurrentControlSet\Control\FileSystem" /v "DontVerifyRandomDrivers" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
::Disable file paths exceeding 260 characters.
Reg add "HKLM\System\CurrentControlSet\Control\FileSystem" /v "LongPathsEnabled" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Disk Optimizations
::Pagefile
wmic pagefileset where name="D:\\pagefile.sys" delete >nul 2>&1
wmic pagefileset create name="C:\pagefile.sys" >nul 2>&1
wmic computersystem where name="%computername%" get AutomaticManagedPagefile | find "TRUE" >nul && wmic computersystem where name="%computername%" set AutomaticManagedPagefile=False >nul 2>&1
wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=32768,MaximumSize=32768 >nul 2>&1
if %errorlevel% neq 0 wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=16384,MaximumSize=16384 >nul 2>&1
if %errorlevel% neq 0 wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=8192,MaximumSize=8192 >nul 2>&1
if %errorlevel% neq 0 wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=4096,MaximumSize=4096 >nul 2>&1
if %errorlevel% neq 0 wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=2048,MaximumSize=2048 >nul 2>&1
if %errorlevel% neq 0 wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=1024,MaximumSize=1024 >nul 2>&1
if %errorlevel% neq 0 (echo Pagefile Failed) else (echo Pagefile)
::Disable Prefetch
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" /v "EnablePrefetcher" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" /v "EnableSuperfetch" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" /v "EnableBoottrace" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Disable Prefetch
::Disable Startup Apps
rem del /f /q "%appdata%\Microsoft\Windows\Start Menu\Programs\Startup\*.*" >>%log% 2>>%error%
rem echo Disable Start Up Programs
::Background Apps
Reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /v "GlobalUserDisabled" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "HKLM\Software\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsRunInBackground" /t REG_DWORD /d "2" /f >>%log% 2>>%error%
Reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Search" /v "BackgroundAppGlobalToggle" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Disable Background Apps
::Free unused ram
Reg add "HKLM\System\CurrentControlSet\Control\Session Manager" /v "HeapDeCommitFreeBlockThreshold" /t REG_DWORD /d "262144" /f >>%log% 2>>%error%
echo Free unused ram
::::::::::::::::::::::
::GPU Optimizations::
::::::::::::::::::::::
cls
title GPU Optimizations
echo [32mGPU Optimizations%col1%
::Disable Display Scaling Credits to Zusier
if "%DisplayScaling%" equ "0x1" for /f %%i in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" /s /f Scaling') do set "str=%%i" & if "!str!" neq "!str:Configuration\=!" (
Reg add "%%i" /v "Scaling" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
echo Disable Display Scaling
)
::Reset application aware DPI scaling
Reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\Display" /v "EnableGdiDPIScaling" /f >>%log% 2>nul
::Enable Preemption
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Scheduler" /v "EnablePreemption" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
echo Enable Preemption
::https://docs.microsoft.com/en-us/windows-hardware/drivers/display/gdi-hardware-acceleration
for /f %%a in ('Reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class" /v "VgaCompatible" /s ^| findstr "HKEY"') do Reg add "%%a" /v "KMD_EnableGDIAcceleration" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
::Enable Hardware Accelerated Scheduling
Reg add "HKLM\System\CurrentControlSet\Control\GraphicsDrivers" /v "HwSchMode" /t REG_DWORD /d "2" /f >>%log% 2>>%error%
echo Enable Hardware Accelerated Scheduling
::GPU
for /f "tokens=2 delims==" %%a in ('wmic path Win32_VideoController get VideoProcessor /value') do (
for %%n in (GeForce NVIDIA RTX GTX) do echo %%a | find "%%n" >nul && set "NVIDIAGPU=Found"
for %%n in (AMD Ryzen) do echo %%a | find "%%n" >nul && set "AMDGPU=Found"
for %%n in (Intel UHD) do echo %%a | find "%%n" >nul && set "INTELGPU=Found"
)
if "!NVIDIAGPU!" equ "Found" (
::Enable GameMode
Reg add "HKCU\Software\Microsoft\GameBar" /v "AllowAutoGameMode" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "HKCU\Software\Microsoft\GameBar" /v "AutoGameModeEnabled" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Echo Enable Gamemode
::Disable Write Combining
Reg add "HKLM\SYSTEM\CurrentControlSet\Services\nvlddmkm" /v "DisableWriteCombining" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
echo Disable Write Combining
::Nvidia Reg
Reg add "HKCU\Software\NVIDIA Corporation\Global\NVTweak\Devices\509901423-0\Color" /v "NvCplUseColorCorrection" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" /v "PlatformSupportMiracast" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
Reg add "HKLM\SYSTEM\CurrentControlSet\Services\nvlddmkm\Global\NVTweak" /v "DisplayPowerSaving" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
::Silk Smoothness Option
Reg add "HKLM\SYSTEM\CurrentControlSet\Services\nvlddmkm\FTS" /v "EnableRID61684" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
echo Silk Smoothness Option
::Opt out of nvidia telemetry
Reg add "HKLM\SOFTWARE\NVIDIA Corporation\NvControlPanel2\Client" /v "OptInOrOutPreference" /t REG_DWORD /d 0 /f >>%log% 2>>%error%
Reg add "HKLM\SOFTWARE\NVIDIA Corporation\Global\FTS" /v "EnableRID44231" /t REG_DWORD /d 0 /f >>%log% 2>>%error%
Reg add "HKLM\SOFTWARE\NVIDIA Corporation\Global\FTS" /v "EnableRID64640" /t REG_DWORD /d 0 /f >>%log% 2>>%error%
Reg add "HKLM\SOFTWARE\NVIDIA Corporation\Global\FTS" /v "EnableRID66610" /t REG_DWORD /d 0 /f >>%log% 2>>%error%
Reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "NvBackend" /f >nul 2>&1
schtasks /change /disable /tn "NvTmRep_CrashReport1_{B2FE1952-0186-46C3-BAEC-A80AA35AC5B8}" >>%log% 2>>%error%
schtasks /change /disable /tn "NvTmRep_CrashReport2_{B2FE1952-0186-46C3-BAEC-A80AA35AC5B8}" >>%log% 2>>%error%
schtasks /change /disable /tn "NvTmRep_CrashReport3_{B2FE1952-0186-46C3-BAEC-A80AA35AC5B8}" >>%log% 2>>%error%
schtasks /change /disable /tn "NvTmRep_CrashReport4_{B2FE1952-0186-46C3-BAEC-A80AA35AC5B8}" >>%log% 2>>%error%
echo Disable Nvidia Telemetry
::Unrestricted Clocks
set cdCache=%cd%
cd "%SystemDrive%\Program Files\NVIDIA Corporation\NVSMI\" >>%log% 2>>%error%
start "" /I /WAIT /B "nvidia-smi" -acp 0 >>%log% 2>>%error%
cd %cdCache%
echo Unrestricted Clocks
::NVCP
if "%NVCP%" equ "0x1" (
start "" /D "%tmp%\nvidiaProfileInspector" nvidiaProfileInspector.exe EchoProfile.nip
echo NVCP Settings
)
::Registry Key For NVIDIA Card
for /f %%a in ('Reg query "HKLM\System\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}" /t REG_SZ /s /e /f "NVIDIA" ^| findstr "HKEY"') do (
::Disalbe Tiled Display
Reg add "%%a" /v "EnableTiledDisplay" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Disable Tiled Display
::Disable TCC
Reg add "%%a" /v "TCCSupported" /t REG_DWORD /d "0" /f >>%log% 2>>%error%
echo Disable TCC
::Disable HDCP
if exist "C:\Program Files (x86)\Steam\steamapps\common\SteamVR" (
Reg delete "%%a" /v "RMHdcpKeyglobZero" /f >>%log% 2>nul
echo Enable HDCP
) else if exist "C:/Program Files/Oculus/Software" (
Reg delete "%%a" /v "RMHdcpKeyglobZero" /f >>%log% 2>nul
echo Enable HDCP
) else (
Reg add "%%a" /v "RMHdcpKeyglobZero" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
echo Disable HDCP
)
::Force contiguous memory allocation
Reg add "%%a" /v "PreferSystemMemoryContiguous" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
echo Force contiguous memory allocation
::PStates 0 Credits to Timecard & Zusier
rem https://github.com/djdallmann/GamingPCSetup/tree/master/CONTENT/RESEARCH/WINDRIVERS#q-is-there-a-registry-setting-that-can-force-your-display-adapter-to-remain-at-its-highest-performance-state-pstate-p0
if "%pstates%" equ "0x1" (Reg add "%%a" /v "DisableDynamicPstate" /t REG_DWORD /d "1" /f) >>%log% 2>>%error%
if "%pstates%" equ "0x0" (Reg delete "%%a" /v "DisableDynamicPstate" /f) >>%log% 2>nul
if "%pstates%" equ "0x1" (echo PStates 0)
::kboost
if "%KBoost%" equ "0x1" (
Reg add "%%a" /v "PowerMizerEnable" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "%%a" /v "PowerMizerLevel" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "%%a" /v "PowerMizerLevelAC" /t REG_DWORD /d "1" /f >>%log% 2>>%error%
Reg add "%%a" /v "PerfLevelSrc" /t REG_DWORD /d "8738" /f >>%log% 2>>%error%
echo KBoost
) else if "%KBoost%" equ "0x0" (
Reg delete "%%a" /v "PowerMizerEnable" /f >>%log% 2>nul
Reg delete "%%a" /v "PowerMizerLevel" /f >>%log% 2>nul
Reg delete "%%a" /v "PowerMizerLevelAC" /f >>%log% 2>nul
Reg delete "%%a" /v "PerfLevelSrc" /f >>%log% 2>nul
)
)
::OC Scanner Fix, cuz why not?
if not exist "%SystemDrive%\Program Files\NVIDIA Corporation\NVSMI" mkdir "%SystemDrive%\Program Files\NVIDIA Corporation\NVSMI" >>%log% 2>>%error%
copy /Y "%windir%\system32\nvml.dll" "%SystemDrive%\Program Files\NVIDIA Corporation\NVSMI\nvml.dll" >>%log% 2>nul
::Disable GpuEnergyDrv
Reg add "HKLM\SYSTEM\CurrentControlSet\Services\GpuEnergyDrv" /v "Start" /t REG_DWORD /d "4" /f >>%log% 2>>%error%
Reg add "HKLM\SYSTEM\CurrentControlSet\Services\GpuEnergyDr" /v "Start" /t REG_DWORD /d "4" /f >>%log% 2>>%error%
echo Disable GpuEnergyDrv
)
if "!AMDGPU!" equ "Found" (
::Disable Gamemode
Reg add "HKCU\Software\Microsoft\GameBar" /v "AllowAutoGameMode" /t REG_DWORD /d "0" /f >nul
Reg add "HKCU\Software\Microsoft\GameBar" /v "AutoGameModeEnabled" /t REG_DWORD /d "0" /f >nul
echo Disable Gamemode
::AMD Registry Location
for /f %%i in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}" /s /v "DriverDesc"^| findstr "HKEY AMD ATI"') do if /i "%%i" neq "DriverDesc" (set "REGPATH_AMD=%%i")
::AMD Tweaks
Reg add "%REGPATH_AMD%" /v "3D_Refresh_Rate_Override_DEF" /t REG_DWORD /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "3to2Pulldown_NA" /t REG_DWORD /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "AAF_NA" /t REG_DWORD /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "Adaptive De-interlacing" /t REG_DWORD /d "1" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "AllowRSOverlay" /t Reg_SZ /d "false" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "AllowSkins" /t Reg_SZ /d "false" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "AllowSnapshot" /t REG_DWORD /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "AllowSubscription" /t REG_DWORD /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "AntiAlias_NA" /t Reg_SZ /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "AreaAniso_NA" /t Reg_SZ /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "ASTT_NA" /t Reg_SZ /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "AutoColorDepthReduction_NA" /t REG_DWORD /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "DisableSAMUPowerGating" /t REG_DWORD /d "1" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "DisableUVDPowerGatingDynamic" /t REG_DWORD /d "1" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "DisableVCEPowerGating" /t REG_DWORD /d "1" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "EnableAspmL0s" /t REG_DWORD /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "EnableAspmL1" /t REG_DWORD /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "EnableUlps" /t REG_DWORD /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "EnableUlps_NA" /t Reg_SZ /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "KMD_DeLagEnabled" /t REG_DWORD /d "1" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "KMD_FRTEnabled" /t REG_DWORD /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "DisableDMACopy" /t REG_DWORD /d "1" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "DisableBlockWrite" /t REG_DWORD /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "StutterMode" /t REG_DWORD /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "EnableUlps" /t REG_DWORD /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "PP_SclkDeepSleepDisable" /t REG_DWORD /d "1" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "PP_ThermalAutoThrottlingEnable" /t REG_DWORD /d "0" /f >nul 2>&1
Reg add "%REGPATH_AMD%" /v "DisableDrmdmaPowerGating" /t REG_DWORD /d "1" /f >nul 2>&1
Reg add "%REGPATH_AMD%\UMD" /v "Main3D_DEF" /t Reg_SZ /d "1" /f >nul 2>&1
Reg add "%REGPATH_AMD%\UMD" /v "Main3D" /t Reg_BINARY /d "3100" /f >nul 2>&1
Reg add "%REGPATH_AMD%\UMD" /v "FlipQueueSize" /t Reg_BINARY /d "3100" /f >nul 2>&1
Reg add "%REGPATH_AMD%\UMD" /v "ShaderCache" /t Reg_BINARY /d "3200" /f >nul 2>&1
Reg add "%REGPATH_AMD%\UMD" /v "Tessellation_OPTION" /t Reg_BINARY /d "3200" /f >nul 2>&1
Reg add "%REGPATH_AMD%\UMD" /v "Tessellation" /t Reg_BINARY /d "3100" /f >nul 2>&1
Reg add "%REGPATH_AMD%\UMD" /v "VSyncControl" /t Reg_BINARY /d "3000" /f >nul 2>&1
Reg add "%REGPATH_AMD%\UMD" /v "TFQ" /t Reg_BINARY /d "3200" /f >nul 2>&1
Reg add "%REGPATH_AMD%\DAL2_DATA__2_0\DisplayPath_4\EDID_D109_78E9\Option" /v "ProtectionControl" /t Reg_BINARY /d "0100000001000000" /f >nul 2>&1
::Melody AMD Tweaks
for %%i in (LTRSnoopL1Latency LTRSnoopL0Latency LTRNoSnoopL1Latency LTRMaxNoSnoopLatency KMD_RpmComputeLatency
DalUrgentLatencyNs memClockSwitchLatency PP_RTPMComputeF1Latency PP_DGBMMMaxTransitionLatencyUvd
PP_DGBPMMaxTransitionLatencyGfx DalNBLatencyForUnderFlow
BGM_LTRSnoopL1Latency BGM_LTRSnoopL0Latency BGM_LTRNoSnoopL1Latency BGM_LTRNoSnoopL0Latency
BGM_LTRMaxSnoopLatencyValue BGM_LTRMaxNoSnoopLatencyValue) do Reg add "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000" /v "%%i" /t REG_DWORD /d "1" /f >nul 2>&1
echo Optimized AMD
echo Optimized AMD GPU
)
if "!INTELGPU!" equ "Found" (
::Intel iGPU tweaks
for /f %%i in ('Reg query "HKLM\System\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}" /t REG_SZ /s /e /f "Intel" ^| findstr "HKEY"') do (
if "%cstates%" equ "0x1" Reg add "%%i" /v "AllowDeepCStates" /t REG_DWORD /d "0" /f
if "%cstates%" equ "0x0" Reg delete "%%i" /v "AllowDeepCStates" /f
Reg add "%%i" /v "Disable_OverlayDSQualityEnhancement" /t REG_DWORD /d "1" /f
Reg add "%%i" /v "IncreaseFixedSegment" /t REG_DWORD /d "1" /f
Reg add "%%i" /v "AdaptiveVsyncEnable" /t REG_DWORD /d "0" /f
Reg add "%%i" /v "DisablePFonDP" /t REG_DWORD /d "1" /f
Reg add "%%i" /v "EnableCompensationForDVI" /t REG_DWORD /d "1" /f
Reg add "%%i" /v "NoFastLinkTrainingForeDP" /t REG_DWORD /d "0" /f
Reg add "%%i" /v "ACPowerPolicyVersion" /t REG_DWORD /d "16898" /f
Reg add "%%i" /v "DCPowerPolicyVersion" /t REG_DWORD /d "16642" /f
) >>%log% 2>nul
if "%cstates%" equ "0x1" (echo Disable CStates)
echo Intel iGPU Settings