forked from ChrisTitusTech/win10script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.ps1
963 lines (869 loc) · 54.1 KB
/
test.ps1
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
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Application]::EnableVisualStyles()
$ErrorActionPreference = 'SilentlyContinue'
$wshell = New-Object -ComObject Wscript.Shell
$Button = [System.Windows.MessageBoxButton]::YesNoCancel
$ErrorIco = [System.Windows.MessageBoxImage]::Error
$Ask = 'Do you want to run this as an Administrator?
Select "Yes" to Run as an Administrator
Select "No" to not run this as an Administrator
Select "Cancel" to stop the script.'
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]'Administrator')) {
$Prompt = [System.Windows.MessageBox]::Show($Ask, "Run as an Administrator or not?", $Button, $ErrorIco)
Switch ($Prompt) {
#This will debloat Windows 10
Yes {
Write-Host "You didn't run this script as an Administrator. This script will self elevate to run as an Administrator and continue."
Start-Process PowerShell.exe -ArgumentList ("-NoProfile -ExecutionPolicy Bypass -File `"{0}`"" -f $PSCommandPath) -Verb RunAs
Exit
}
No {
Break
}
}
}
$Form = New-Object system.Windows.Forms.Form
$Form.ClientSize = New-Object System.Drawing.Point(1050,700)
$Form.text = "Form"
$Form.TopMost = $false
$Panel1 = New-Object system.Windows.Forms.Panel
$Panel1.height = 156
$Panel1.width = 1032
$Panel1.location = New-Object System.Drawing.Point(9,90)
$Label1 = New-Object system.Windows.Forms.Label
$Label1.text = "Program Installation"
$Label1.AutoSize = $true
$Label1.width = 25
$Label1.height = 10
$Label1.location = New-Object System.Drawing.Point(10,30)
$Label1.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',30)
$installchoco = New-Object system.Windows.Forms.Button
$installchoco.text = "Install Chocolatey"
$installchoco.width = 200
$installchoco.height = 115
$installchoco.location = New-Object System.Drawing.Point(16,19)
$installchoco.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',16)
$brave = New-Object system.Windows.Forms.Button
$brave.text = "Brave Browser"
$brave.width = 150
$brave.height = 30
$brave.location = New-Object System.Drawing.Point(250,19)
$brave.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$firefox = New-Object system.Windows.Forms.Button
$firefox.text = "Firefox"
$firefox.width = 150
$firefox.height = 30
$firefox.location = New-Object System.Drawing.Point(250,61)
$firefox.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$7zip = New-Object system.Windows.Forms.Button
$7zip.text = "7-Zip"
$7zip.width = 150
$7zip.height = 30
$7zip.location = New-Object System.Drawing.Point(584,104)
$7zip.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$irfanview = New-Object system.Windows.Forms.Button
$irfanview.text = "Irfanview"
$irfanview.width = 150
$irfanview.height = 30
$irfanview.location = New-Object System.Drawing.Point(417,19)
$irfanview.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$adobereader = New-Object system.Windows.Forms.Button
$adobereader.text = "Adobe Reader DC"
$adobereader.width = 150
$adobereader.height = 30
$adobereader.location = New-Object System.Drawing.Point(417,61)
$adobereader.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$notepad = New-Object system.Windows.Forms.Button
$notepad.text = "Notepad++"
$notepad.width = 150
$notepad.height = 30
$notepad.location = New-Object System.Drawing.Point(417,104)
$notepad.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$gchrome = New-Object system.Windows.Forms.Button
$gchrome.text = "Google Chrome"
$gchrome.width = 150
$gchrome.height = 30
$gchrome.location = New-Object System.Drawing.Point(250,104)
$gchrome.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$mpc = New-Object system.Windows.Forms.Button
$mpc.text = "Media Player Classic"
$mpc.width = 150
$mpc.height = 30
$mpc.location = New-Object System.Drawing.Point(584,61)
$mpc.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$vlc = New-Object system.Windows.Forms.Button
$vlc.text = "VLC"
$vlc.width = 150
$vlc.height = 30
$vlc.location = New-Object System.Drawing.Point(584,19)
$vlc.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$powertoys = New-Object system.Windows.Forms.Button
$powertoys.text = "PowerToys"
$powertoys.width = 150
$powertoys.height = 30
$powertoys.location = New-Object System.Drawing.Point(751,105)
$powertoys.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$winterminal = New-Object system.Windows.Forms.Button
$winterminal.text = "Windows Terminal"
$winterminal.width = 150
$winterminal.height = 30
$winterminal.location = New-Object System.Drawing.Point(751,61)
$winterminal.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$vscode = New-Object system.Windows.Forms.Button
$vscode.text = "VS Code"
$vscode.width = 150
$vscode.height = 30
$vscode.location = New-Object System.Drawing.Point(751,19)
$vscode.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$Label2 = New-Object system.Windows.Forms.Label
$Label2.text = "(Chocolatey Required for installs)"
$Label2.AutoSize = $true
$Label2.width = 25
$Label2.height = 10
$Label2.location = New-Object System.Drawing.Point(478,3)
$Label2.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Panel2 = New-Object system.Windows.Forms.Panel
$Panel2.height = 159
$Panel2.width = 588
$Panel2.location = New-Object System.Drawing.Point(9,293)
$Label3 = New-Object system.Windows.Forms.Label
$Label3.text = "System Tweaks"
$Label3.AutoSize = $true
$Label3.width = 230
$Label3.height = 25
$Label3.location = New-Object System.Drawing.Point(195,251)
$Label3.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',24)
$essentialtweaks = New-Object system.Windows.Forms.Button
$essentialtweaks.text = "Essential Tweaks"
$essentialtweaks.width = 200
$essentialtweaks.height = 115
$essentialtweaks.location = New-Object System.Drawing.Point(24,34)
$essentialtweaks.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',14)
$backgroundapps = New-Object system.Windows.Forms.Button
$backgroundapps.text = "Background Apps"
$backgroundapps.width = 150
$backgroundapps.height = 30
$backgroundapps.location = New-Object System.Drawing.Point(251,45)
$backgroundapps.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$cortana = New-Object system.Windows.Forms.Button
$cortana.text = "Cortana"
$cortana.width = 150
$cortana.height = 30
$cortana.location = New-Object System.Drawing.Point(251,82)
$cortana.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$windowssearch = New-Object system.Windows.Forms.Button
$windowssearch.text = "Windows Search"
$windowssearch.width = 150
$windowssearch.height = 30
$windowssearch.location = New-Object System.Drawing.Point(417,119)
$windowssearch.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$actioncenter = New-Object system.Windows.Forms.Button
$actioncenter.text = "Action Center"
$actioncenter.width = 150
$actioncenter.height = 30
$actioncenter.location = New-Object System.Drawing.Point(251,9)
$actioncenter.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$darkmode = New-Object system.Windows.Forms.Button
$darkmode.text = "Dark Mode"
$darkmode.width = 150
$darkmode.height = 30
$darkmode.location = New-Object System.Drawing.Point(417,7)
$darkmode.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$visualfx = New-Object system.Windows.Forms.Button
$visualfx.text = "Visual FX"
$visualfx.width = 150
$visualfx.height = 30
$visualfx.location = New-Object System.Drawing.Point(417,82)
$visualfx.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$onedrive = New-Object system.Windows.Forms.Button
$onedrive.text = "OneDrive"
$onedrive.width = 150
$onedrive.height = 30
$onedrive.location = New-Object System.Drawing.Point(251,119)
$onedrive.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$Panel3 = New-Object system.Windows.Forms.Panel
$Panel3.height = 158
$Panel3.width = 440
$Panel3.location = New-Object System.Drawing.Point(601,293)
$Label4 = New-Object system.Windows.Forms.Label
$Label4.text = "Security"
$Label4.AutoSize = $true
$Label4.width = 117
$Label4.height = 25
$Label4.location = New-Object System.Drawing.Point(761,252)
$Label4.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',24)
$securitylow = New-Object system.Windows.Forms.Button
$securitylow.text = "Low"
$securitylow.width = 150
$securitylow.height = 30
$securitylow.location = New-Object System.Drawing.Point(36,119)
$securitylow.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))
$securityhigh = New-Object system.Windows.Forms.Button
$securityhigh.text = "High"
$securityhigh.width = 150
$securityhigh.height = 30
$securityhigh.location = New-Object System.Drawing.Point(244,119)
$securityhigh.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))
$Label5 = New-Object system.Windows.Forms.Label
$Label5.text = "- Set UAC to Never Prompt"
$Label5.AutoSize = $true
$Label5.width = 150
$Label5.height = 10
$Label5.location = New-Object System.Drawing.Point(24,40)
$Label5.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Label6 = New-Object system.Windows.Forms.Label
$Label6.text = "- Disable Windows Defender"
$Label6.AutoSize = $true
$Label6.width = 150
$Label6.height = 10
$Label6.location = New-Object System.Drawing.Point(24,6)
$Label6.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Label7 = New-Object system.Windows.Forms.Label
$Label7.text = "- Disable Defender Updates"
$Label7.AutoSize = $true
$Label7.width = 150
$Label7.height = 10
$Label7.location = New-Object System.Drawing.Point(24,23)
$Label7.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Label8 = New-Object system.Windows.Forms.Label
$Label8.text = "- Disable Windows Malware Scan"
$Label8.AutoSize = $true
$Label8.width = 150
$Label8.height = 10
$Label8.location = New-Object System.Drawing.Point(24,75)
$Label8.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Label9 = New-Object system.Windows.Forms.Label
$Label9.text = "- Disable Meltdown Flag"
$Label9.AutoSize = $true
$Label9.width = 150
$Label9.height = 10
$Label9.location = New-Object System.Drawing.Point(24,58)
$Label9.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Label10 = New-Object system.Windows.Forms.Label
$Label10.text = "- Set UAC to Always Prompt"
$Label10.AutoSize = $true
$Label10.width = 25
$Label10.height = 10
$Label10.location = New-Object System.Drawing.Point(233,40)
$Label10.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Label11 = New-Object system.Windows.Forms.Label
$Label11.text = "- Enable Windows Defender"
$Label11.AutoSize = $true
$Label11.width = 25
$Label11.height = 10
$Label11.location = New-Object System.Drawing.Point(233,57)
$Label11.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Label12 = New-Object system.Windows.Forms.Label
$Label12.text = "- Enable Windows Malware Scan"
$Label12.AutoSize = $true
$Label12.width = 25
$Label12.height = 10
$Label12.location = New-Object System.Drawing.Point(233,6)
$Label12.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Label13 = New-Object system.Windows.Forms.Label
$Label13.text = "- Enable Meltdown Flag"
$Label13.AutoSize = $true
$Label13.width = 25
$Label13.height = 10
$Label13.location = New-Object System.Drawing.Point(233,23)
$Label13.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Label15 = New-Object system.Windows.Forms.Label
$Label15.text = "Windows Update"
$Label15.AutoSize = $true
$Label15.width = 25
$Label15.height = 10
$Label15.location = New-Object System.Drawing.Point(58,459)
$Label15.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',24)
$Panel4 = New-Object system.Windows.Forms.Panel
$Panel4.height = 168
$Panel4.width = 340
$Panel4.location = New-Object System.Drawing.Point(9,491)
$defaultwindowsupdate = New-Object system.Windows.Forms.Button
$defaultwindowsupdate.text = "Default Settings"
$defaultwindowsupdate.width = 300
$defaultwindowsupdate.height = 30
$defaultwindowsupdate.location = New-Object System.Drawing.Point(20,13)
$defaultwindowsupdate.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',14)
$securitywindowsupdate = New-Object system.Windows.Forms.Button
$securitywindowsupdate.text = "Security Updates Only"
$securitywindowsupdate.width = 300
$securitywindowsupdate.height = 30
$securitywindowsupdate.location = New-Object System.Drawing.Point(20,119)
$securitywindowsupdate.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',14)
$Label16 = New-Object system.Windows.Forms.Label
$Label16.text = "I recommend doing security updates only."
$Label16.AutoSize = $true
$Label16.width = 25
$Label16.height = 10
$Label16.location = New-Object System.Drawing.Point(47,49)
$Label16.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Label17 = New-Object system.Windows.Forms.Label
$Label17.text = "- Delays Features updates up to 3 years"
$Label17.AutoSize = $true
$Label17.width = 25
$Label17.height = 10
$Label17.location = New-Object System.Drawing.Point(71,66)
$Label17.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Label18 = New-Object system.Windows.Forms.Label
$Label18.text = "- Delays Security updates 4 days"
$Label18.AutoSize = $true
$Label18.width = 25
$Label18.height = 10
$Label18.location = New-Object System.Drawing.Point(71,84)
$Label18.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Label19 = New-Object system.Windows.Forms.Label
$Label19.text = "- Sets Maximum Active Time"
$Label19.AutoSize = $true
$Label19.width = 25
$Label19.height = 10
$Label19.location = New-Object System.Drawing.Point(71,103)
$Label19.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Label20 = New-Object system.Windows.Forms.Label
$Label20.text = "Instructions"
$Label20.AutoSize = $true
$Label20.width = 169
$Label20.height = 23
$Label20.location = New-Object System.Drawing.Point(581,463)
$Label20.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',24)
$Label21 = New-Object system.Windows.Forms.Label
$Label21.text = "- This will modify your system and I highly recommend backing up any data you have prior to running!"
$Label21.AutoSize = $true
$Label21.width = 150
$Label21.height = 10
$Label21.location = New-Object System.Drawing.Point(390,507)
$Label21.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Label22 = New-Object system.Windows.Forms.Label
$Label22.text = "(Unsure!?... Just apply Essential Tweaks)"
$Label22.AutoSize = $true
$Label22.width = 150
$Label22.height = 10
$Label22.location = New-Object System.Drawing.Point(4,14)
$Label22.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Label23 = New-Object system.Windows.Forms.Label
$Label23.text = "- Need to Restore action center, cortana, etc.? Run the Restore Script: https://youtu.be/H2ydDcqRZyM"
$Label23.AutoSize = $true
$Label23.width = 150
$Label23.height = 10
$Label23.location = New-Object System.Drawing.Point(390,529)
$Label23.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$PictureBox1 = New-Object system.Windows.Forms.PictureBox
$PictureBox1.width = 412
$PictureBox1.height = 125
$PictureBox1.location = New-Object System.Drawing.Point(449,541)
$PictureBox1.imageLocation = "https://github.com/ChrisTitusTech/win10script/blob/master/titus-toolbox.png?raw=true"
$PictureBox1.SizeMode = [System.Windows.Forms.PictureBoxSizeMode]::zoom
$lightmode = New-Object system.Windows.Forms.Button
$lightmode.text = "Light Mode"
$lightmode.width = 150
$lightmode.height = 30
$lightmode.location = New-Object System.Drawing.Point(417,45)
$lightmode.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)
$Form.controls.AddRange(@($Panel1,$Label1,$Panel2,$Label3,$Panel3,$Label4,$Label15,$Panel4,$Label20,$Label21,$Label23,$PictureBox1))
$Panel1.controls.AddRange(@($installchoco,$brave,$firefox,$7zip,$irfanview,$adobereader,$notepad,$gchrome,$mpc,$vlc,$powertoys,$winterminal,$vscode,$Label2))
$Panel2.controls.AddRange(@($essentialtweaks,$backgroundapps,$cortana,$windowssearch,$actioncenter,$darkmode,$visualfx,$onedrive,$Label22,$lightmode))
$Panel3.controls.AddRange(@($securitylow,$securityhigh,$Label5,$Label6,$Label7,$Label8,$Label9,$Label10,$Label11,$Label12,$Label13))
$Panel4.controls.AddRange(@($defaultwindowsupdate,$securitywindowsupdate,$Label16,$Label17,$Label18,$Label19))
$installchoco.Add_Click({
Write-Host "Installing Chocolatey"
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install chocolatey-core.extension -y
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$brave.Add_Click({
Invoke-WebRequest -Uri "https://laptop-updates.brave.com/download/CHR253" -OutFile $env:USERPROFILE\Downloads\brave.exe
~/Downloads/brave.exe
})
$firefox.Add_Click({
Write-Host "Installing Firefox"
choco install firefox -y
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$irfanview.Add_Click({
Write-Host "Installing Irfanview (Image Viewer)"
choco install irfanview -y
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$adobereader.Add_Click({
Write-Host "Installing Adobe Reader DC"
choco install adobereader -y
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$notepad.Add_Click({
Write-Host "Installing Notepad++"
choco install notepadplusplus -y
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$vlc.Add_Click({
Write-Host "Installing VLC Media Player"
choco install vlc -y
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$mpc.Add_Click({
Write-Host "Installing Media Player Classic"
choco install mpc-be -y
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$7zip.Add_Click({
Write-Host "Installing 7-Zip Compression Tool"
choco install 7zip -y
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$vscode.Add_Click({
Write-Host "Installing Visual Studio Code"
choco install vscode -y
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$winterminal.Add_Click({
Write-Host "Installing New Windows Terminal"
choco install microsoft-windows-terminal -y
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$powertoys.Add_Click({
Write-Host "Installing Microsoft PowerToys"
choco install powertoys -y
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$essentialtweaks.Add_Click({
Write-Host "Creating Restore Point incase something bad happens"
Enable-ComputerRestore -Drive "C:\"
Checkpoint-Computer -Description "RestorePoint1" -RestorePointType "MODIFY_SETTINGS"
Write-Host "Running O&O Shutup with Recommended Settings"
Import-Module BitsTransfer
Start-BitsTransfer -Source "https://raw.githubusercontent.com/ChrisTitusTech/win10script/master/ooshutup10.cfg" -Destination ooshutup10.cfg
Start-BitsTransfer -Source "https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe" -Destination OOSU10.exe
./OOSU10.exe ooshutup10.cfg /quiet
Write-Host "Disabling Telemetry..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\ProgramDataUpdater" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Autochk\Proxy" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null
Write-Host "Disabling Application suggestions..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "ContentDeliveryAllowed" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "OemPreInstalledAppsEnabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEnabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEverEnabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SilentInstalledAppsEnabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338387Enabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338388Enabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338389Enabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353698Enabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 1
Write-Host "Disabling Activity History..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableActivityFeed" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "PublishUserActivities" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "UploadUserActivities" -Type DWord -Value 0
Write-Host "Disabling Location Tracking..."
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Type String -Value "Deny"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 0
Write-Host "Disabling automatic Maps updates..."
Set-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -Type DWord -Value 0
Write-Host "Disabling Feedback..."
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "DoNotShowFeedbackNotifications" -Type DWord -Value 1
Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClient" -ErrorAction SilentlyContinue | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" -ErrorAction SilentlyContinue | Out-Null
Write-Host "Disabling Tailored Experiences..."
If (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) {
New-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -Type DWord -Value 1
Write-Host "Disabling Advertising ID..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Name "DisabledByGroupPolicy" -Type DWord -Value 1
Write-Host "Disabling Error reporting..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -Type DWord -Value 1
Disable-ScheduledTask -TaskName "Microsoft\Windows\Windows Error Reporting\QueueReporting" | Out-Null
Write-Host "Restricting Windows Update P2P only to local network..."
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1
Write-Host "Stopping and disabling Diagnostics Tracking Service..."
Stop-Service "DiagTrack" -WarningAction SilentlyContinue
Set-Service "DiagTrack" -StartupType Disabled
Write-Host "Stopping and disabling WAP Push Service..."
Stop-Service "dmwappushservice" -WarningAction SilentlyContinue
Set-Service "dmwappushservice" -StartupType Disabled
Write-Host "Enabling F8 boot menu options..."
bcdedit /set `{current`} bootmenupolicy Legacy | Out-Null
Write-Host "Stopping and disabling Home Groups services..."
Stop-Service "HomeGroupListener" -WarningAction SilentlyContinue
Set-Service "HomeGroupListener" -StartupType Disabled
Stop-Service "HomeGroupProvider" -WarningAction SilentlyContinue
Set-Service "HomeGroupProvider" -StartupType Disabled
Write-Host "Disabling Shared Experiences..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableCdp" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableMmx" -Type DWord -Value 0
Write-Host "Disabling Remote Assistance..."
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 0
Write-Host "Disabling Storage Sense..."
Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" -Recurse -ErrorAction SilentlyContinue
Write-Host "Stopping and disabling Superfetch service..."
Stop-Service "SysMain" -WarningAction SilentlyContinue
Set-Service "SysMain" -StartupType Disabled
Write-Host "Setting BIOS time to UTC..."
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" -Name "RealTimeIsUniversal" -Type DWord -Value 1
Write-Host "Disabling Hibernation..."
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Session Manager\Power" -Name "HibernteEnabled" -Type Dword -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" -Name "ShowHibernateOption" -Type Dword -Value 0
Write-Host "Showing task manager details..."
$taskmgr = Start-Process -WindowStyle Hidden -FilePath taskmgr.exe -PassThru
Do {
Start-Sleep -Milliseconds 100
$preferences = Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -ErrorAction SilentlyContinue
} Until ($preferences)
Stop-Process $taskmgr
$preferences.Preferences[28] = 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -Type Binary -Value $preferences.Preferences
Write-Host "Showing file operations details..."
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Name "EnthusiastMode" -Type DWord -Value 1
Write-Host "Hiding Task View button..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Type DWord -Value 0
Write-Host "Hiding People icon..."
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" -Name "PeopleBand" -Type DWord -Value 0
Write-Host "Showing all tray icons..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Type DWord -Value 0
Write-Host "Enabling NumLock after startup..."
If (!(Test-Path "HKU:")) {
New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null
}
Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 2147483650
Add-Type -AssemblyName System.Windows.Forms
If (!([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) {
$wsh = New-Object -ComObject WScript.Shell
$wsh.SendKeys('{NUMLOCK}')
}
Write-Host "Changing default Explorer view to This PC..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 1
Write-Host "Hiding 3D Objects icon from This PC..."
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" -Recurse -ErrorAction SilentlyContinue
$Bloatware = @(
#Unnecessary Windows 10 AppX Apps
"Microsoft.3DBuilder"
"Microsoft.AppConnector"
"Microsoft.BingFinance"
"Microsoft.BingNews"
"Microsoft.BingSports"
"Microsoft.BingTranslator"
"Microsoft.BingWeather"
"Microsoft.GetHelp"
"Microsoft.Getstarted"
"Microsoft.Messaging"
"Microsoft.Microsoft3DViewer"
"Microsoft.MicrosoftSolitaireCollection"
"Microsoft.NetworkSpeedTest"
"Microsoft.News"
"Microsoft.Office.Lens"
"Microsoft.Office.Sway"
"Microsoft.OneConnect"
"Microsoft.People"
"Microsoft.Print3D"
"Microsoft.SkypeApp"
"Microsoft.StorePurchaseApp"
"Microsoft.Wallet"
"Microsoft.Whiteboard"
"Microsoft.WindowsAlarms"
"microsoft.windowscommunicationsapps"
"Microsoft.WindowsFeedbackHub"
"Microsoft.WindowsMaps"
"Microsoft.WindowsSoundRecorder"
"Microsoft.ZuneMusic"
"Microsoft.ZuneVideo"
#Sponsored Windows 10 AppX Apps
#Add sponsored/featured apps to remove in the "*AppName*" format
"*EclipseManager*"
"*ActiproSoftwareLLC*"
"*AdobeSystemsIncorporated.AdobePhotoshopExpress*"
"*Duolingo-LearnLanguagesforFree*"
"*PandoraMediaInc*"
"*CandyCrush*"
"*BubbleWitch3Saga*"
"*Wunderlist*"
"*Flipboard*"
"*Twitter*"
"*Facebook*"
"*Royal Revolt*"
"*Sway*"
"*Speed Test*"
"*Dolby*"
"*Viber*"
"*ACGMediaPlayer*"
"*Netflix*"
"*OneCalendar*"
"*LinkedInforWindows*"
"*HiddenCityMysteryofShadows*"
"*Hulu*"
"*HiddenCity*"
"*AdobePhotoshopExpress*"
#Optional: Typically not removed but you can if you need to for some reason
#"*Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe*"
#"*Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe*"
#"*Microsoft.BingWeather*"
#"*Microsoft.MSPaint*"
#"*Microsoft.MicrosoftStickyNotes*"
#"*Microsoft.Windows.Photos*"
#"*Microsoft.WindowsCalculator*"
#"*Microsoft.WindowsStore*"
)
foreach ($Bloat in $Bloatware) {
Get-AppxPackage -Name $Bloat| Remove-AppxPackage
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $Bloat | Remove-AppxProvisionedPackage -Online
Write-Host "Trying to remove $Bloat."
}
Write-Host "Installing Windows Media Player..."
Enable-WindowsOptionalFeature -Online -FeatureName "WindowsMediaPlayer" -NoRestart -WarningAction SilentlyContinue | Out-Null
#Stops edge from taking over as the default .PDF viewer
Write-Host "Stopping Edge from taking over as the default .PDF viewer"
$NoPDF = "HKCR:\.pdf"
$NoProgids = "HKCR:\.pdf\OpenWithProgids"
$NoWithList = "HKCR:\.pdf\OpenWithList"
If (!(Get-ItemProperty $NoPDF NoOpenWith)) {
New-ItemProperty $NoPDF NoOpenWith
}
If (!(Get-ItemProperty $NoPDF NoStaticDefaultVerb)) {
New-ItemProperty $NoPDF NoStaticDefaultVerb
}
If (!(Get-ItemProperty $NoProgids NoOpenWith)) {
New-ItemProperty $NoProgids NoOpenWith
}
If (!(Get-ItemProperty $NoProgids NoStaticDefaultVerb)) {
New-ItemProperty $NoProgids NoStaticDefaultVerb
}
If (!(Get-ItemProperty $NoWithList NoOpenWith)) {
New-ItemProperty $NoWithList NoOpenWith
}
If (!(Get-ItemProperty $NoWithList NoStaticDefaultVerb)) {
New-ItemProperty $NoWithList NoStaticDefaultVerb
}
#Appends an underscore '_' to the Registry key for Edge
$Edge = "HKCR:\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_"
If (Test-Path $Edge) {
Set-Item $Edge AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_
}
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$windowssearch.Add_Click({
Write-Host "Disabling Bing Search in Start Menu..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "CortanaConsent" -Type DWord -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "DisableWebSearch" -Type DWord -Value 1
Write-Host "Stopping and disabling Windows Search indexing service..."
Stop-Service "WSearch" -WarningAction SilentlyContinue
Set-Service "WSearch" -StartupType Disabled
Write-Host "Hiding Taskbar Search icon / box..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Type DWord -Value 0
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$backgroundapps.Add_Click({
Write-Host "Disabling Background application access..."
Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Exclude "Microsoft.Windows.Cortana*" | ForEach {
Set-ItemProperty -Path $_.PsPath -Name "Disabled" -Type DWord -Value 1
Set-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -Type DWord -Value 1
}
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$cortana.Add_Click({
Write-Host "Disabling Cortana..."
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 0
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 1
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -Type DWord -Value 0
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$securitylow.Add_Click({
Write-Host "Lowering UAC level..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 0
Write-Host "Disabling Windows Defender..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -Type DWord -Value 1
If ([System.Environment]::OSVersion.Version.Build -eq 14393) {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name "WindowsDefender" -ErrorAction SilentlyContinue
} ElseIf ([System.Environment]::OSVersion.Version.Build -ge 15063) {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name "SecurityHealth" -ErrorAction SilentlyContinue
}
Write-Host "Disabling Windows Defender Cloud..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" -Name "SpynetReporting" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" -Name "SubmitSamplesConsent" -Type DWord -Value 2
Write-Host "Disabling Meltdown (CVE-2017-5754) compatibility flag..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\QualityCompat" -Name "cadca5fe-87d3-4b96-b7fb-a231484277cc" -ErrorAction SilentlyContinue
Write-Host "Disabling Malicious Software Removal Tool offering..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\MRT")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\MRT" | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\MRT" -Name "DontOfferThroughWUAU" -Type DWord -Value 1
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$securityhigh.Add_Click({
Write-Host "Raising UAC level..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 5
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 1
Write-Host "Disabling SMB 1.0 protocol..."
Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force
Write-Host "Enabling Windows Defender..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -ErrorAction SilentlyContinue
If ([System.Environment]::OSVersion.Version.Build -eq 14393) {
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name "WindowsDefender" -Type ExpandString -Value "`"%ProgramFiles%\Windows Defender\MSASCuiL.exe`""
} ElseIf ([System.Environment]::OSVersion.Version.Build -ge 15063) {
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name "SecurityHealth" -Type ExpandString -Value "`"%ProgramFiles%\Windows Defender\MSASCuiL.exe`""
}
Write-Host "Enabling Windows Defender Cloud..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" -Name "SpynetReporting" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" -Name "SubmitSamplesConsent" -ErrorAction SilentlyContinue
Write-Host "Disabling Windows Script Host..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name "Enabled" -Type DWord -Value 0
Write-Host "Enabling Meltdown (CVE-2017-5754) compatibility flag..."
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\QualityCompat")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\QualityCompat" | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\QualityCompat" -Name "cadca5fe-87d3-4b96-b7fb-a231484277cc" -Type DWord -Value 0
Write-Host "Enabling Malicious Software Removal Tool offering..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\MRT" -Name "DontOfferThroughWUAU" -ErrorAction SilentlyContinue
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$defaultwindowsupdate.Add_Click({
Write-Host "Enabling driver offering through Windows Update..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -ErrorAction SilentlyContinue
Write-Host "Enabling Windows Update automatic restart..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -ErrorAction SilentlyContinue
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$securitywindowsupdate.Add_Click({
Write-Host "Disabling driver offering through Windows Update..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -Type DWord -Value 1
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -Type DWord -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -Type DWord -Value 1
Write-Host "Disabling Windows Update automatic restart..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -Type DWord -Value 0
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$actioncenter.Add_Click({
Write-Host "Disabling Action Center..."
If (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer")) {
New-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer" | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" -Type DWord -Value 0
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$visualfx.Add_Click({
Write-Host "Adjusting visual effects for performance..."
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "DragFullWindows" -Type String -Value 0
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "MenuShowDelay" -Type String -Value 0
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask" -Type Binary -Value ([byte[]](144,18,3,128,16,0,0,0))
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop\WindowMetrics" -Name "MinAnimate" -Type String -Value 0
Set-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name "KeyboardDelay" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewAlphaSelect" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewShadow" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAnimations" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" -Name "VisualFXSetting" -Type DWord -Value 3
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "EnableAeroPeek" -Type DWord -Value 0
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$onedrive.Add_Click({
Write-Host "Disabling OneDrive..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -Type DWord -Value 1
Write-Host "Uninstalling OneDrive..."
Stop-Process -Name "OneDrive" -ErrorAction SilentlyContinue
Start-Sleep -s 2
$onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
If (!(Test-Path $onedrive)) {
$onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"
}
Start-Process $onedrive "/uninstall" -NoNewWindow -Wait
Start-Sleep -s 2
Stop-Process -Name "explorer" -ErrorAction SilentlyContinue
Start-Sleep -s 2
Remove-Item -Path "$env:USERPROFILE\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path "$env:PROGRAMDATA\Microsoft OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path "$env:SYSTEMDRIVE\OneDriveTemp" -Force -Recurse -ErrorAction SilentlyContinue
If (!(Test-Path "HKCR:")) {
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
}
Remove-Item -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$darkmode.Add_Click({
Write-Host "Enabling Dark Mode"
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
$lightmode.Add_Click({
Write-Host "Switching Back to Light Mode"
Remove-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme
$wshell.Popup("Operation Completed",0,"Done",0x0)
})
[void]$Form.ShowDialog()