forked from ChrisTitusTech/bypassnro
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunattendedtr.xml
More file actions
2252 lines (1990 loc) · 143 KB
/
Copy pathunattendedtr.xml
File metadata and controls
2252 lines (1990 loc) · 143 KB
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
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
<!-- XML Generated by Winhance https://github.com/memstechtips/Winhance -->
<settings pass="offlineServicing"></settings>
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<SetupUILanguage>
<UILanguage>tr-TR</UILanguage>
</SetupUILanguage>
<InputLocale>041f:0000041f</InputLocale>
<SystemLocale>tr-TR</SystemLocale>
<UILanguage>tr-TR</UILanguage>
<UserLocale>tr-TR</UserLocale>
</component>
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<SetupUILanguage>
<UILanguage>tr-TR</UILanguage>
</SetupUILanguage>
<InputLocale>041f:0000041f</InputLocale>
<SystemLocale>tr-TR</SystemLocale>
<UILanguage>tr-TR</UILanguage>
<UserLocale>tr-TR</UserLocale>
</component>
<component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<UserData>
<ProductKey>
<Key>00000-00000-00000-00000-00000</Key>
<WillShowUI>Always</WillShowUI>
</ProductKey>
<AcceptEula>true</AcceptEula>
</UserData>
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Order 1-6: Skip Windows 11 Hardware Requirement Checks</Description>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassTPMCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassSecureBootCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>3</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassStorageCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>4</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassCPUCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>5</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassRAMCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>6</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassDiskCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
<component name="Microsoft-Windows-Setup" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<UserData>
<ProductKey>
<Key>00000-00000-00000-00000-00000</Key>
<WillShowUI>Always</WillShowUI>
</ProductKey>
<AcceptEula>true</AcceptEula>
</UserData>
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Order 1-6: Skip Windows 11 Hardware Requirement Checks</Description>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassTPMCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassSecureBootCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>3</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassStorageCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>4</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassCPUCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>5</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassRAMCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>6</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassDiskCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<UserData>
<ProductKey>
<Key>00000-00000-00000-00000-00000</Key>
<WillShowUI>Always</WillShowUI>
</ProductKey>
<AcceptEula>true</AcceptEula>
</UserData>
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Order 1-6: Skip Windows 11 Hardware Requirement Checks</Description>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassTPMCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassSecureBootCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>3</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassStorageCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>4</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassCPUCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>5</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassRAMCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>6</Order>
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassDiskCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>
<settings pass="generalize"></settings>
<settings pass="specialize">
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<InputLocale>041f:0000041f</InputLocale>
<SystemLocale>tr-TR</SystemLocale>
<UILanguage>tr-TR</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>tr-TR</UserLocale>
</component>
<component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<InputLocale>041f:0000041f</InputLocale>
<SystemLocale>tr-TR</SystemLocale>
<UILanguage>tr-TR</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>tr-TR</UserLocale>
</component>
<component name="Microsoft-Windows-Deployment" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Loads Scripts in this XML File</Description>
<Path>powershell.exe -NoProfile -WindowStyle Hidden -Command "$xml = [xml]::new(); $xml.Load('C:\Windows\Panther\unattend.xml'); $sb = [scriptblock]::Create( $xml.unattend.Extensions.ExtractScript ); Invoke-Command -ScriptBlock $sb -ArgumentList $xml;"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Registry Entry to Create a Local Account during OOBE</Description>
<Path>reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE" /v BypassNRO /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>3</Order>
<Description>Disable All Network Adapters Temporarily so Windows Doesn't Update During OOBE and to Allow Local Account Creation</Description>
<Path>powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command "Get-NetAdapter | Disable-NetAdapter -Confirm:$false"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>4</Order>
<Description>Enables .NET Framework 3.5 from Windows Installation Media</Description>
<Path>powershell.exe -NoProfile -WindowStyle Hidden -Command "foreach($d in 'C','D','E','F','G','H','I','J','K'){$src=Join-Path ($d+':') 'sources\sxs';if(Test-Path $src\*.cab){dism /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:$src;break}}"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>5</Order>
<Description>Runs Winhance Script System Wide Operations like App Uninstalls, HKLM Registry entries etc.</Description>
<Path>powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File "C:\ProgramData\Winhance\Unattend\Scripts\Winhancements.ps1"</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
<component name="Microsoft-Windows-Deployment" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Loads Scripts in this XML File</Description>
<Path>powershell.exe -NoProfile -WindowStyle Hidden -Command "$xml = [xml]::new(); $xml.Load('C:\Windows\Panther\unattend.xml'); $sb = [scriptblock]::Create( $xml.unattend.Extensions.ExtractScript ); Invoke-Command -ScriptBlock $sb -ArgumentList $xml;"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Registry Entry to Create a Local Account during OOBE</Description>
<Path>reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE" /v BypassNRO /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>3</Order>
<Description>Disable All Network Adapters Temporarily so Windows Doesn't Update During OOBE and to Allow Local Account Creation</Description>
<Path>powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command "Get-NetAdapter | Disable-NetAdapter -Confirm:$false"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>4</Order>
<Description>Enables .NET Framework 3.5 from Windows Installation Media</Description>
<Path>powershell.exe -NoProfile -WindowStyle Hidden -Command "foreach($d in 'C','D','E','F','G','H','I','J','K'){$src=Join-Path ($d+':') 'sources\sxs';if(Test-Path $src\*.cab){dism /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:$src;break}}"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>5</Order>
<Description>Runs Winhance Script System Wide Operations like App Uninstalls, HKLM Registry entries etc.</Description>
<Path>powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File "C:\ProgramData\Winhance\Unattend\Scripts\Winhancements.ps1"</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Loads Scripts in this XML File</Description>
<Path>powershell.exe -NoProfile -WindowStyle Hidden -Command "$xml = [xml]::new(); $xml.Load('C:\Windows\Panther\unattend.xml'); $sb = [scriptblock]::Create( $xml.unattend.Extensions.ExtractScript ); Invoke-Command -ScriptBlock $sb -ArgumentList $xml;"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Registry Entry to Create a Local Account during OOBE</Description>
<Path>reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE" /v BypassNRO /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>3</Order>
<Description>Disable All Network Adapters Temporarily so Windows Doesn't Update During OOBE and to Allow Local Account Creation</Description>
<Path>powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command "Get-NetAdapter | Disable-NetAdapter -Confirm:$false"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>4</Order>
<Description>Enables .NET Framework 3.5 from Windows Installation Media</Description>
<Path>powershell.exe -NoProfile -WindowStyle Hidden -Command "foreach($d in 'C','D','E','F','G','H','I','J','K'){$src=Join-Path ($d+':') 'sources\sxs';if(Test-Path $src\*.cab){dism /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:$src;break}}"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>5</Order>
<Description>Runs Winhance Script System Wide Operations like App Uninstalls, HKLM Registry entries etc.</Description>
<Path>powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File "C:\ProgramData\Winhance\Unattend\Scripts\Winhancements.ps1"</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>
<settings pass="auditSystem"></settings>
<settings pass="auditUser"></settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<InputLocale>041f:0000041f</InputLocale>
<SystemLocale>tr-TR</SystemLocale>
<UILanguage>tr-TR</UILanguage>
<UserLocale>tr-TR</UserLocale>
</component>
<component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<InputLocale>041f:0000041f</InputLocale>
<SystemLocale>tr-TR</SystemLocale>
<UILanguage>tr-TR</UILanguage>
<UserLocale>tr-TR</UserLocale>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Work</NetworkLocation>
<ProtectYourPC>3</ProtectYourPC>
</OOBE>
<FirstLogonCommands>
<SynchronousCommand>
<Order>1</Order>
<Description>Enables Network Adapters After OOBE Completes</Description>
<CommandLine>powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command "Get-NetAdapter | Enable-NetAdapter -Confirm:$false"</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Work</NetworkLocation>
<ProtectYourPC>3</ProtectYourPC>
</OOBE>
<FirstLogonCommands>
<SynchronousCommand>
<Order>1</Order>
<Description>Enables Network Adapters After OOBE Completes</Description>
<CommandLine>powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command "Get-NetAdapter | Enable-NetAdapter -Confirm:$false"</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Work</NetworkLocation>
<ProtectYourPC>3</ProtectYourPC>
</OOBE>
<FirstLogonCommands>
<SynchronousCommand>
<Order>1</Order>
<Description>Enables Network Adapters After OOBE Completes</Description>
<CommandLine>powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command "Get-NetAdapter | Enable-NetAdapter -Confirm:$false"</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
</component>
</settings>
<Extensions xmlns="urn:winhance:unattend">
<ExtractScript>
param(
[xml] $Document
);
$scriptsDir = 'C:\ProgramData\Winhance\Unattend\Scripts\';
foreach( $file in $Document.unattend.Extensions.File ) {
$path = [System.Environment]::ExpandEnvironmentVariables(
$file.GetAttribute( 'path' )
);
if( $path.StartsWith( $scriptsDir ) ) {
mkdir -Path $scriptsDir -ErrorAction 'SilentlyContinue';
}
$encoding = switch( [System.IO.Path]::GetExtension( $path ) ) {
{ $_ -in '.ps1', '.xml' } { [System.Text.Encoding]::UTF8; }
{ $_ -in '.reg', '.vbs', '.js' } { [System.Text.UnicodeEncoding]::new( $false, $true ); }
default { [System.Text.Encoding]::Default; }
};
[System.IO.File]::WriteAllBytes( $path, ( $encoding.GetPreamble() + $encoding.GetBytes( $file.InnerText.Trim() ) ) );
}
</ExtractScript>
<File path="C:\ProgramData\Winhance\Unattend\Scripts\Winhancements.ps1"><![CDATA[<#
.SYNOPSIS
Winhance Windows 10/11 Customization and Optimization Script
.DESCRIPTION
Applies registry settings, UWP app removals, optimizations and customizations based on Windows version detection
.NOTES
Requires Administrator privileges
Compatible with Windows 10 and Windows 11
Logs all activities to C:\ProgramData\Winhance\Unattend\Logs\Winhancements.txt
.PARAMETER UserCustomizations
When specified, applies ONLY HKCU (user-specific) registry settings.
When not specified, applies all settings EXCEPT HKCU entries.
Note: User customizations are tracked and will only apply once per user.
To re-apply, delete: HKCU\Software\Winhance\UserCustomizationsApplied
.EXAMPLE
.\Winhancements.ps1
Runs in normal mode - applies all system-wide settings (HKLM) but skips user settings (HKCU)
.EXAMPLE
.\Winhancements.ps1 -UserCustomizations
Runs in user mode - applies ONLY user-specific settings (HKCU)
#>
param(
[switch]$UserCustomizations
)
# ============================================================================
# LOGGING SETUP
# ============================================================================
$LogPath = 'C:\ProgramData\Winhance\Unattend\Logs\Winhancements.txt'
$null = New-Item -Path (Split-Path $LogPath) -ItemType Directory -Force
function Write-Log {
param(
[string]$Message,
[ValidateSet("INFO", "SUCCESS", "WARNING", "ERROR")]
[string]$Level = "INFO"
)
$Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$LogEntry = "[$Timestamp] [$Level] $Message"
# Write to log file
Add-Content -Path $LogPath -Value $LogEntry -Encoding UTF8
# Optional: Also write to console for real-time monitoring
# Uncomment the next line if you want console output during testing
# Write-Host $LogEntry
}
# Initialize log file
Write-Log "=================================================================================" "INFO"
Write-Log "Winhance Windows Optimization & Customization Script Started" "INFO"
Write-Log "Script Path: $($MyInvocation.MyCommand.Path)" "INFO"
Write-Log "Log File: $LogPath" "INFO"
if ($UserCustomizations) {
Write-Log "MODE: User Customizations Only (HKCU registry entries)" "INFO"
} else {
Write-Log "MODE: System Customizations (All settings except HKCU entries)" "INFO"
}
Write-Log "=================================================================================" "INFO"
function Get-TargetUser {
try {
$user = Get-WmiObject Win32_ComputerSystem | Select-Object -ExpandProperty UserName
if ($user -and $user -ne "NT AUTHORITY\SYSTEM") {
$username = $user.Split('\')[1]
if ($username -ne "defaultuser0") {
return $username
}
}
} catch { }
try {
$explorer = Get-Process explorer -ErrorAction SilentlyContinue | Select-Object -First 1
if ($explorer) {
$owner = $explorer.GetOwner()
if ($owner.User -ne "defaultuser0") {
return $owner.User
}
}
} catch { }
return $null
}
function Get-UserSID {
param($Username)
try {
$user = New-Object System.Security.Principal.NTAccount($Username)
return $user.Translate([System.Security.Principal.SecurityIdentifier]).Value
} catch {
return $null
}
}
function Set-RegistryValue {
param(
[string]$Path,
[string]$Name,
[string]$Type,
$Value,
[string]$Description
)
try {
if (-not (Test-Path $Path)) {
New-Item -Path $Path -Force | Out-Null
}
Set-ItemProperty -Path $Path -Name $Name -Value $Value -Type $Type -Force
Write-Log "$Description | $Path\$Name = $Value" "SUCCESS"
}
catch {
Write-Log "Failed to set $Path\$Name : $($_.Exception.Message)" "ERROR"
}
}
function Remove-RegistryValue {
param(
[string]$Path,
[string]$Name,
[string]$Description
)
try {
if (Test-Path $Path) {
$existingValue = Get-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue
if ($existingValue) {
Remove-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue
Write-Log "$Description | Removed $Path\$Name" "SUCCESS"
}
}
}
catch {
Write-Log "Failed to remove $Path\$Name : $($_.Exception.Message)" "ERROR"
}
}
function Remove-RegistryKey {
param(
[string]$Path,
[string]$Description
)
try {
if (Test-Path $Path) {
Remove-Item -Path $Path -Recurse -Force -ErrorAction SilentlyContinue
Write-Log "$Description | Removed key $Path" "SUCCESS"
}
}
catch {
Write-Log "Failed to remove key $Path : $($_.Exception.Message)" "ERROR"
}
}
function New-RegistryKey {
param(
[string]$Path,
[string]$Description
)
try {
if (-not (Test-Path $Path)) {
New-Item -Path $Path -Force | Out-Null
Write-Log "$Description | Created key $Path" "SUCCESS"
}
}
catch {
Write-Log "Failed to create key $Path : $($_.Exception.Message)" "ERROR"
}
}
function Set-BinaryBit {
param(
[string]$Path,
[string]$Name,
[int]$ByteIndex,
[byte]$BitMask,
[bool]$SetBit,
[string]$Description
)
try {
if (-not (Test-Path $Path)) {
New-Item -Path $Path -Force | Out-Null
}
$currentValue = Get-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue
if ($null -eq $currentValue -or $null -eq $currentValue.$Name) {
$bytes = New-Object byte[] ([Math]::Max(12, $ByteIndex + 1))
} else {
$bytes = $currentValue.$Name
if ($bytes.Length -le $ByteIndex) {
$newBytes = New-Object byte[] ($ByteIndex + 1)
[Array]::Copy($bytes, $newBytes, $bytes.Length)
$bytes = $newBytes
}
}
if ($SetBit) {
$bytes[$ByteIndex] = $bytes[$ByteIndex] -bor $BitMask
} else {
$bytes[$ByteIndex] = $bytes[$ByteIndex] -band (-bnot $BitMask)
}
Set-ItemProperty -Path $Path -Name $Name -Value $bytes -Type Binary -Force
Write-Log "$Description | $Path\$Name bit mask 0x$($BitMask.ToString('X2')) at byte $ByteIndex = $SetBit" "SUCCESS"
}
catch {
Write-Log "Failed to modify binary bit $Path\$Name : $($_.Exception.Message)" "ERROR"
}
}
function Set-BinaryByte {
param(
[string]$Path,
[string]$Name,
[int]$ByteIndex,
[byte]$ByteValue,
[string]$Description
)
try {
if (-not (Test-Path $Path)) {
New-Item -Path $Path -Force | Out-Null
}
$currentValue = Get-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue
if ($null -eq $currentValue -or $null -eq $currentValue.$Name) {
$bytes = New-Object byte[] ([Math]::Max(12, $ByteIndex + 1))
} else {
$bytes = $currentValue.$Name
if ($bytes.Length -le $ByteIndex) {
$newBytes = New-Object byte[] ($ByteIndex + 1)
[Array]::Copy($bytes, $newBytes, $bytes.Length)
$bytes = $newBytes
}
}
$bytes[$ByteIndex] = $ByteValue
Set-ItemProperty -Path $Path -Name $Name -Value $bytes -Type Binary -Force
Write-Log "$Description | $Path\$Name byte $ByteIndex = 0x$($ByteValue.ToString('X2'))" "SUCCESS"
}
catch {
Write-Log "Failed to modify binary byte $Path\$Name : $($_.Exception.Message)" "ERROR"
}
}
if (-not $UserCustomizations) {
$scriptsDir = "C:\ProgramData\Winhance\Scripts"
if (!(Test-Path $scriptsDir)) {
New-Item -ItemType Directory -Path $scriptsDir -Force | Out-Null
Write-Log "Created scripts directory: $scriptsDir" "SUCCESS"
} else {
Write-Log "Scripts directory already exists: $scriptsDir" "INFO"
}
# ============================================================================
# WINDOWS APPS REMOVAL
# ============================================================================
# Create BloatRemoval.ps1 script
$bloatRemovalContent = @'
<#
.SYNOPSIS
Removes Windows bloatware apps, legacy capabilities, and optional features from Windows 10/11 systems.
.DESCRIPTION
This script removes selected Windows components including:
- Appx packages (UWP apps like Calculator, Weather, etc.)
- Legacy Windows capabilities
- Optional Windows features
- Special apps requiring custom uninstall procedures (e.g., OneNote)
The script includes retry logic and verification to ensure complete removal.
This script is designed to run in any context: user sessions, SYSTEM account, or scheduled tasks.
.NOTES
Source: https://github.com/memstechtips/Winhance
Requirements:
- Windows 10/11
- Administrator privileges (script will auto-elevate)
- PowerShell 5.1 or higher
#>
# Check if script is running as Administrator
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) {
Try {
Start-Process PowerShell.exe -ArgumentList ("-NoProfile -ExecutionPolicy Bypass -File `"{0}`"" -f $PSCommandPath) -Verb RunAs
Exit
}
Catch {
Write-Host "Failed to run as Administrator. Please rerun with elevated privileges."
Exit
}
}
# Setup logging
$logFolder = "C:\ProgramData\Winhance\Logs"
$logFile = "$logFolder\BloatRemovalLog.txt"
# Create log directory if it doesn't exist
if (!(Test-Path $logFolder)) {
New-Item -ItemType Directory -Path $logFolder -Force | Out-Null
}
# Function to write to log file
function Write-Log {
param (
[string]$Message
)
# Check if log file exists and is over 500KB (512000 bytes)
if ((Test-Path $logFile) -and (Get-Item $logFile).Length -gt 512000) {
Remove-Item $logFile -Force -ErrorAction SilentlyContinue
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
"$timestamp - Log rotated - previous log exceeded 500KB" | Out-File -FilePath $logFile
}
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
"$timestamp - $Message" | Out-File -FilePath $logFile -Append
# Also output to console for real-time progress
Write-Host $Message
}
Write-Log "Starting bloat removal process"
# Enable Remove-AppX -AllUsers compatibility aliases for this session
Write-Log "Setting up AppX compatibility aliases for this session..."
try {
Set-Alias Get-AppPackageAutoUpdateSettings Get-AppxPackageAutoUpdateSettings -Scope Global -Force
Set-Alias Remove-AppPackageAutoUpdateSettings Remove-AppxPackageAutoUpdateSettings -Scope Global -Force
Set-Alias Set-AppPackageAutoUpdateSettings Set-AppxPackageAutoUpdateSettings -Scope Global -Force
Set-Alias Reset-AppPackage Reset-AppxPackage -Scope Global -Force
Set-Alias Add-MsixPackage Add-AppxPackage -Scope Global -Force
Set-Alias Get-MsixPackage Get-AppxPackage -Scope Global -Force
Set-Alias Remove-MsixPackage Remove-AppxPackage -Scope Global -Force
Write-Log "AppX compatibility aliases created successfully"
} catch {
Write-Log "Warning: Could not create some AppX aliases: $($_.Exception.Message)"
}
# Packages to remove
$packages = @(
'Microsoft.Microsoft3DViewer'
'Microsoft.MixedReality.Portal'
'Microsoft.BingSearch'
'Microsoft.BingNews'
'Microsoft.BingWeather'
'Clipchamp.Clipchamp'
'Microsoft.WindowsAlarms'
'Microsoft.549981C3F5F10'
'Microsoft.GetHelp'
'Microsoft.Windows.DevHome'
'MicrosoftCorporationII.MicrosoftFamily'
'microsoft.windowscommunicationsapps'
'Microsoft.SkypeApp'
'MSTeams'
'Microsoft.WindowsFeedbackHub'
'Microsoft.WindowsMaps'
'Microsoft.MicrosoftOfficeHub'
'Microsoft.OutlookForWindows'
'Microsoft.MSPaint'
'Microsoft.People'
'Microsoft.PowerAutomateDesktop'
'Microsoft.MicrosoftSolitaireCollection'
'Microsoft.ZuneMusic'
'Microsoft.ZuneVideo'
'Microsoft.WindowsSoundRecorder'
'Microsoft.MicrosoftStickyNotes'
'Microsoft.Getstarted'
'Microsoft.Todos'
'Microsoft.YourPhone'
'Microsoft.Copilot'
'Microsoft.Windows.Ai.Copilot.Provider'
'Microsoft.Copilot_8wekyb3d8bbwe'
'Microsoft.Office.OneNote'
)
# Capabilities to remove
$capabilities = @(
'App.Support.QuickAssist'
'Microsoft.Windows.WordPad'
'Microsoft.Windows.Notepad'
'Microsoft.Windows.MSPaint'
'OpenSSH.Server'
)
# Optional Features to disable
$optionalFeatures = @(
'Microsoft-Windows-Subsystem-Linux'
'Recall'
)
# Special apps requiring uninstall string execution
$specialApps = @(
'OneNote'
)
$maxRetries = 3
$retryCount = 0
do {
$retryCount++
Write-Log "Standard removal attempt $retryCount of $maxRetries"
Write-Log "Discovering all packages..."
$allInstalledPackages = Get-AppxPackage -AllUsers -ErrorAction SilentlyContinue
$allProvisionedPackages = Get-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
Write-Log "Processing packages..."
$packagesToRemove = @()
$provisionedPackagesToRemove = @()
$notFoundPackages = @()
foreach ($package in $packages) {
$foundAny = $false
$installedPackages = $allInstalledPackages | Where-Object { $_.Name -eq $package }
if ($installedPackages) {
Write-Log "Found installed package: $package"
foreach ($pkg in $installedPackages) {
Write-Log "Queuing installed package for removal: $($pkg.PackageFullName)"
$packagesToRemove += $pkg.PackageFullName
}
$foundAny = $true
}
$provisionedPackages = $allProvisionedPackages | Where-Object { $_.DisplayName -eq $package }
if ($provisionedPackages) {
Write-Log "Found provisioned package: $package"
foreach ($pkg in $provisionedPackages) {
Write-Log "Queuing provisioned package for removal: $($pkg.PackageName)"
$provisionedPackagesToRemove += $pkg.PackageName
}
$foundAny = $true
}
if (-not $foundAny) {
$notFoundPackages += $package
}
}
if ($notFoundPackages.Count -gt 0) {
Write-Log "Packages not found: $($notFoundPackages -join ', ')"
}
if ($packagesToRemove.Count -gt 0) {
Write-Log "Removing $($packagesToRemove.Count) installed packages in batch..."
try {
$packagesToRemove | ForEach-Object {
Write-Log "Removing installed package: $_"
Remove-AppxPackage -Package $_ -AllUsers -ErrorAction SilentlyContinue
}
Write-Log "Batch removal of installed packages completed"
} catch {
Write-Log "Error in batch removal of installed packages: $($_.Exception.Message)"
}
}
if ($provisionedPackagesToRemove.Count -gt 0) {
Write-Log "Removing $($provisionedPackagesToRemove.Count) provisioned packages..."
foreach ($pkgName in $provisionedPackagesToRemove) {
try {
Write-Log "Removing provisioned package: $pkgName"
Remove-AppxProvisionedPackage -Online -PackageName $pkgName -ErrorAction SilentlyContinue
} catch {
Write-Log "Error removing provisioned package $pkgName : $($_.Exception.Message)"
}
}
Write-Log "Provisioned packages removal completed"
}
Write-Log "Processing capabilities..."
foreach ($capability in $capabilities) {
Write-Log "Checking capability: $capability"
try {
$matchingCapabilities = Get-WindowsCapability -Online | Where-Object { $_.Name -like "$capability*" -or $_.Name -like "$capability~~~~*" }
if ($matchingCapabilities) {
$foundInstalled = $false
foreach ($existingCapability in $matchingCapabilities) {
if ($existingCapability.State -eq "Installed") {
$foundInstalled = $true
Write-Log "Removing capability: $($existingCapability.Name)"
Remove-WindowsCapability -Online -Name $existingCapability.Name -ErrorAction SilentlyContinue | Out-Null
}
}
if (-not $foundInstalled) {
Write-Log "Found capability $capability but it is not installed"
}
}
else {
Write-Log "No matching capabilities found for: $capability"
}
}
catch {
Write-Log "Error checking capability: $capability - $($_.Exception.Message)"
}
}
Write-Log "Processing optional features..."
if ($optionalFeatures.Count -gt 0) {
$enabledFeatures = @()
foreach ($feature in $optionalFeatures) {
Write-Log "Checking feature: $feature"
$existingFeature = Get-WindowsOptionalFeature -Online -FeatureName $feature -ErrorAction SilentlyContinue
if ($existingFeature -and $existingFeature.State -eq "Enabled") {
$enabledFeatures += $feature
} else {
Write-Log "Feature not found or not enabled: $feature"
}
}
if ($enabledFeatures.Count -gt 0) {
Write-Log "Disabling features: $($enabledFeatures -join ', ')"
Disable-WindowsOptionalFeature -Online -FeatureName $enabledFeatures -NoRestart -ErrorAction SilentlyContinue | Out-Null
}
}
Write-Log "Verifying removal results..."
$remainingItems = @()
$currentPackages = Get-AppxPackage -AllUsers -ErrorAction SilentlyContinue
foreach ($package in $packages) {
if ($currentPackages | Where-Object { $_.Name -eq $package }) {
$remainingItems += $package
Write-Log "Package still installed: $package"
}
}
$currentCapabilities = Get-WindowsCapability -Online -ErrorAction SilentlyContinue | Where-Object State -eq 'Installed'
foreach ($capability in $capabilities) {
if ($currentCapabilities | Where-Object { $_.Name -like "$capability*" }) {
$remainingItems += $capability
Write-Log "Capability still installed: $capability"
}
}
$currentFeatures = Get-WindowsOptionalFeature -Online -ErrorAction SilentlyContinue | Where-Object State -eq 'Enabled'
foreach ($feature in $optionalFeatures) {
if ($currentFeatures | Where-Object { $_.FeatureName -eq $feature }) {
$remainingItems += $feature
Write-Log "Feature still enabled: $feature"
}
}
if ($remainingItems.Count -eq 0) {
Write-Log "All standard items successfully removed!"
break
} else {
Write-Log "Retry needed. $($remainingItems.Count) items remain: $($remainingItems -join ', ')"
if ($retryCount -lt $maxRetries) {
Write-Log "Waiting 2 seconds before retry..."
Start-Sleep -Seconds 2
}
}
} while ($retryCount -lt $maxRetries -and $remainingItems.Count -gt 0)
if ($remainingItems.Count -gt 0) {
Write-Log "Warning: $($remainingItems.Count) standard items could not be removed after $maxRetries attempts: $($remainingItems -join ', ')"
}
if ($specialApps.Count -gt 0) {
Write-Log "Processing special apps that require custom uninstall procedures..."
$maxSpecialRetries = 2
$specialRetryCount = 0
$specialAppsRemaining = @()
do {
$specialRetryCount++
if ($specialRetryCount -gt 1) {
Write-Log "Special apps retry attempt $specialRetryCount of $maxSpecialRetries"
}
$uninstallBasePaths = @(
'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall',
'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'
)
foreach ($specialApp in $specialApps) {
Write-Log "Processing special app: $specialApp"
switch ($specialApp) {
'OneNote' {
$processesToStop = @('OneNote', 'ONENOTE', 'ONENOTEM')
$searchPattern = 'OneNote*'
$packagePattern = '*OneNote*'
}
default {
Write-Log "Unknown or unsupported special app: $specialApp"
continue
}
}
foreach ($processName in $processesToStop) {
$processes = Get-Process -Name $processName -ErrorAction SilentlyContinue
if ($processes) {
$processes | Stop-Process -Force -ErrorAction SilentlyContinue
Write-Log "Stopped process: $processName"
}
}
$uninstallExecuted = $false
foreach ($uninstallBasePath in $uninstallBasePaths) {
try {
Write-Log "Searching for $searchPattern in $uninstallBasePath"
$uninstallKeys = Get-ChildItem -Path $uninstallBasePath -ErrorAction SilentlyContinue |
Where-Object { $_.PSChildName -like $searchPattern }
foreach ($key in $uninstallKeys) {
try {
$uninstallString = (Get-ItemProperty -Path $key.PSPath -ErrorAction SilentlyContinue).UninstallString
if ($uninstallString) {
Write-Log "Found uninstall string: $uninstallString"
if ($uninstallString -match '^\"([^\"]+)\"(.*)$') {
$exePath = $matches[1]
$args = $matches[2].Trim()
if ($exePath -like '*OfficeClickToRun.exe') {
$args += ' DisplayLevel=False'
} else {
$args += ' /silent'
}
Write-Log "Executing: $exePath with args: $args"
Start-Process -FilePath $exePath -ArgumentList $args -NoNewWindow -Wait -ErrorAction SilentlyContinue
} else {
if ($uninstallString -like '*OfficeClickToRun.exe*') {
Start-Process -FilePath $uninstallString -ArgumentList 'DisplayLevel=False' -NoNewWindow -Wait -ErrorAction SilentlyContinue
} else {
Start-Process -FilePath $uninstallString -ArgumentList '/silent' -NoNewWindow -Wait -ErrorAction SilentlyContinue
}
}
$uninstallExecuted = $true
Write-Log "Completed uninstall execution for $specialApp"
}
}
catch {
Write-Log "Error processing uninstall key: $($_.Exception.Message)"
}
}
}
catch {
Write-Log "Error searching for uninstall keys: $($_.Exception.Message)"
}
}
if (-not $uninstallExecuted) {
Write-Log "No uninstall strings found for $specialApp"
}
}
if ($specialRetryCount -eq 1) {
Write-Log "Waiting 3 seconds for uninstallers to complete..."
Start-Sleep -Seconds 3
}
Write-Log "Verifying special apps removal..."
$specialAppsRemaining = @()
foreach ($specialApp in $specialApps) {
$stillExists = $false
switch ($specialApp) {