Autounattend
Autounattend
>
<unattend xmlns="urn:schemas-microsoft-com:unattend"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
<!-- UnattendedWinstall
https://github.com/memstechtips/UnattendedWinstall -->
<settings pass="offlineServicing"></settings>
<settings pass="windowsPE">
<component name="Microsoft-Windows-Setup"
processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
language="neutral" versionScope="nonSxS">
<UserData>
<ProductKey>
<Key>00000-00000-00000-00000-00000</Key>
</ProductKey>
<AcceptEula>true</AcceptEula>
</UserData>
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<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>
<!--Disables Windows Defender from Starting -->
<RunSynchronousCommand wcm:action="add">
<Order>7</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Echo "Scanning for newly created SYSTEM registry
hive file to disable Windows Defender services...""</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>8</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Set fso = CreateObject( "Scripting.FileSystemObject"
)"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>9</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Set dic = CreateObject( "Scripting.Dictionary" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>10</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo initialized = false"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>11</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Function Execute( command )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>12</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Echo "Running command '" + command + "'""</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>13</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Set shell = CreateObject( "WScript.Shell" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>14</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Set exec = shell.Exec( command )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>15</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Do While exec.Status = 0"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>16</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Sleep 100"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>17</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Loop"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>18</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Echo exec.StdOut.ReadAll"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>19</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Echo exec.StdErr.ReadAll"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>20</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Execute = exec.ExitCode"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>21</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo End Function"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>22</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Do"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>23</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo For Each drive In fso.Drives"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>24</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo If drive.IsReady Then"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>25</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo If drive.DriveLetter ^<^> "X" Then"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>26</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo For Each folder In Array( "$Windows.~BT\
NewOS\Windows", "Windows" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>27</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo file =
fso.BuildPath( fso.BuildPath( drive.RootFolder, folder ),
"System32\config\SYSTEM" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>28</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo If fso.FileExists( file ) And
fso.FileExists( file + ".LOG1" ) And fso.FileExists( file +
".LOG2" ) Then"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>29</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo If Not initialized Then"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>30</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo dic.Add file, Nothing"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>31</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo ElseIf Not dic.Exists( file )
Then"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>32</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Set shell =
CreateObject( "WScript.Shell" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>33</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo ret = 1"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>34</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Do"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>35</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Sleep 500"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>36</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo ret = Execute( "reg.exe LOAD
HKLM\mount " + file )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>37</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Loop While ret ^> 0"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>38</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo For Each service In
Array( "Sense", "WdBoot", "WdFilter", "WdNisDrv", "WdNisSvc",
"WinDefend" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>39</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo ret = Execute( "reg.exe ADD
HKLM\mount\ControlSet001\Services\" + service + " /v Start /t
REG_DWORD /d 4 /f" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>40</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Next"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>41</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo ret = Execute( "reg.exe UNLOAD
HKLM\mount" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>42</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Echo "Found SYSTEM
registry hive file at '" + file + "'. This window will now
close.""</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>43</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Sleep 5000"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>44</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Exit Do"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>45</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo End If"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>46</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo End If"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>47</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Next"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>48</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo End If"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>49</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo End If"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>50</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Next"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>51</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo initialized = true"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>52</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Sleep 1000"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>53</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Loop"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>54</Order>
<Path>cmd.exe /c "start /MIN cscript.exe //E:vbscript
X:\disable-defender.vbs"</Path>
</RunSynchronousCommand>
<!--Prevents auto detection of Windows Edition and forces
Windows Setup to show all available Editions of Windows during
setup.-->
<RunSynchronousCommand wcm:action="add">
<Order>55</Order>
<Path>cmd.exe /c del /f /q X:\Sources\ei.cfg</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>56</Order>
<Path>cmd.exe /c echo [Channel] >
X:\Sources\ei.cfg</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>57</Order>
<Path>cmd.exe /c echo _Default >>
X:\Sources\ei.cfg</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>58</Order>
<Path>cmd.exe /c echo [VL] >> X:\Sources\ei.cfg</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>59</Order>
<Path>cmd.exe /c echo 0 >> X:\Sources\ei.cfg</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>
</ProductKey>
<AcceptEula>true</AcceptEula>
</UserData>
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<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>
<!--Disables Windows Defender from Starting -->
<RunSynchronousCommand wcm:action="add">
<Order>7</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Echo "Scanning for newly created SYSTEM registry
hive file to disable Windows Defender services...""</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>8</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Set fso = CreateObject( "Scripting.FileSystemObject"
)"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>9</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Set dic = CreateObject( "Scripting.Dictionary" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>10</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo initialized = false"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>11</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Function Execute( command )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>12</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Echo "Running command '" + command + "'""</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>13</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Set shell = CreateObject( "WScript.Shell" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>14</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Set exec = shell.Exec( command )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>15</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Do While exec.Status = 0"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>16</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Sleep 100"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>17</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Loop"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>18</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Echo exec.StdOut.ReadAll"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>19</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Echo exec.StdErr.ReadAll"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>20</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Execute = exec.ExitCode"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>21</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo End Function"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>22</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Do"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>23</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo For Each drive In fso.Drives"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>24</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo If drive.IsReady Then"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>25</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo If drive.DriveLetter ^<^> "X" Then"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>26</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo For Each folder In Array( "$Windows.~BT\
NewOS\Windows", "Windows" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>27</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo file =
fso.BuildPath( fso.BuildPath( drive.RootFolder, folder ),
"System32\config\SYSTEM" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>28</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo If fso.FileExists( file ) And
fso.FileExists( file + ".LOG1" ) And fso.FileExists( file +
".LOG2" ) Then"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>29</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo If Not initialized Then"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>30</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo dic.Add file, Nothing"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>31</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo ElseIf Not dic.Exists( file )
Then"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>32</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Set shell =
CreateObject( "WScript.Shell" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>33</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo ret = 1"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>34</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Do"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>35</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Sleep 500"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>36</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo ret = Execute( "reg.exe LOAD
HKLM\mount " + file )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>37</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Loop While ret ^> 0"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>38</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo For Each service In
Array( "Sense", "WdBoot", "WdFilter", "WdNisDrv", "WdNisSvc",
"WinDefend" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>39</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo ret = Execute( "reg.exe ADD
HKLM\mount\ControlSet001\Services\" + service + " /v Start /t
REG_DWORD /d 4 /f" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>40</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Next"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>41</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo ret = Execute( "reg.exe UNLOAD
HKLM\mount" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>42</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Echo "Found SYSTEM
registry hive file at '" + file + "'. This window will now
close.""</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>43</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Sleep 5000"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>44</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Exit Do"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>45</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo End If"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>46</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo End If"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>47</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Next"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>48</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo End If"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>49</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo End If"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>50</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Next"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>51</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo initialized = true"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>52</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Sleep 1000"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>53</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Loop"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>54</Order>
<Path>cmd.exe /c "start /MIN cscript.exe //E:vbscript
X:\disable-defender.vbs"</Path>
</RunSynchronousCommand>
<!--Prevents auto detection of Windows Edition and forces
Windows Setup to show all available Editions of Windows during
setup.-->
<RunSynchronousCommand wcm:action="add">
<Order>55</Order>
<Path>cmd.exe /c del /f /q X:\Sources\ei.cfg</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>56</Order>
<Path>cmd.exe /c echo [Channel] >
X:\Sources\ei.cfg</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>57</Order>
<Path>cmd.exe /c echo _Default >>
X:\Sources\ei.cfg</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>58</Order>
<Path>cmd.exe /c echo [VL] >> X:\Sources\ei.cfg</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>59</Order>
<Path>cmd.exe /c echo 0 >> X:\Sources\ei.cfg</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>
</ProductKey>
<AcceptEula>true</AcceptEula>
</UserData>
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<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>
<!--Disables Windows Defender from Starting -->
<RunSynchronousCommand wcm:action="add">
<Order>7</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Echo "Scanning for newly created SYSTEM registry
hive file to disable Windows Defender services...""</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>8</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Set fso = CreateObject( "Scripting.FileSystemObject"
)"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>9</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Set dic = CreateObject( "Scripting.Dictionary" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>10</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo initialized = false"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>11</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Function Execute( command )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>12</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Echo "Running command '" + command + "'""</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>13</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Set shell = CreateObject( "WScript.Shell" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>14</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Set exec = shell.Exec( command )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>15</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Do While exec.Status = 0"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>16</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Sleep 100"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>17</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Loop"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>18</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Echo exec.StdOut.ReadAll"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>19</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Echo exec.StdErr.ReadAll"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>20</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Execute = exec.ExitCode"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>21</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo End Function"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>22</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Do"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>23</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo For Each drive In fso.Drives"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>24</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo If drive.IsReady Then"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>25</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo If drive.DriveLetter ^<^> "X" Then"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>26</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo For Each folder In Array( "$Windows.~BT\
NewOS\Windows", "Windows" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>27</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo file =
fso.BuildPath( fso.BuildPath( drive.RootFolder, folder ),
"System32\config\SYSTEM" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>28</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo If fso.FileExists( file ) And
fso.FileExists( file + ".LOG1" ) And fso.FileExists( file +
".LOG2" ) Then"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>29</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo If Not initialized Then"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>30</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo dic.Add file, Nothing"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>31</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo ElseIf Not dic.Exists( file )
Then"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>32</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Set shell =
CreateObject( "WScript.Shell" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>33</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo ret = 1"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>34</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Do"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>35</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Sleep 500"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>36</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo ret = Execute( "reg.exe LOAD
HKLM\mount " + file )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>37</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Loop While ret ^> 0"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>38</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo For Each service In
Array( "Sense", "WdBoot", "WdFilter", "WdNisDrv", "WdNisSvc",
"WinDefend" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>39</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo ret = Execute( "reg.exe ADD
HKLM\mount\ControlSet001\Services\" + service + " /v Start /t
REG_DWORD /d 4 /f" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>40</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Next"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>41</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo ret = Execute( "reg.exe UNLOAD
HKLM\mount" )"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>42</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Echo "Found SYSTEM
registry hive file at '" + file + "'. This window will now
close.""</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>43</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Sleep 5000"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>44</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Exit Do"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>45</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo End If"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>46</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo End If"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>47</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Next"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>48</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo End If"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>49</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo End If"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>50</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Next"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>51</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo initialized = true"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>52</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo WScript.Sleep 1000"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>53</Order>
<Path>cmd.exe /c ">>"X:\disable-defender.vbs"
echo Loop"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>54</Order>
<Path>cmd.exe /c "start /MIN cscript.exe //E:vbscript
X:\disable-defender.vbs"</Path>
</RunSynchronousCommand>
<!--Prevents auto detection of Windows Edition and forces
Windows Setup to show all available Editions of Windows during
setup.-->
<RunSynchronousCommand wcm:action="add">
<Order>55</Order>
<Path>cmd.exe /c del /f /q X:\Sources\ei.cfg</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>56</Order>
<Path>cmd.exe /c echo [Channel] >
X:\Sources\ei.cfg</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>57</Order>
<Path>cmd.exe /c echo _Default >>
X:\Sources\ei.cfg</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>58</Order>
<Path>cmd.exe /c echo [VL] >> X:\Sources\ei.cfg</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>59</Order>
<Path>cmd.exe /c echo 0 >> X:\Sources\ei.cfg</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>
<settings pass="generalize"></settings>
<settings pass="specialize">
<component name="Microsoft-Windows-Deployment"
processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
language="neutral" versionScope="nonSxS">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<!-- Loads Scripts in File -->
<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>
<!-- Disables User Account Control -->
<Path>reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\
Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t
REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>3</Order>
<!-- Enables Running of PowerShell Scripts -->
<Path>powershell.exe -NoProfile -WindowStyle Hidden -
Command "Set-ExecutionPolicy RemoteSigned -Scope LocalMachine -
Force"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>4</Order>
<!-- Skips Forced Microsoft Account Creation -->
<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>5</Order>
<!-- Runs Script to Enable .NET3.5 from Windows
Installation Media -->
<Path>powershell.exe -NoProfile -WindowStyle Hidden -
ExecutionPolicy Bypass -File "C:\Windows\Temp\DotNet.ps1"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>6</Order>
<!-- Creates Specialize Phase Marker File -->
<Path>cmd.exe /c echo Specialized Setup > "C:\
specialize_marker.txt"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>7</Order>
<!-- Runs Recommended UnattendedWinstall Scripts -->
<Path>powershell.exe -NoProfile -WindowStyle Hidden -
ExecutionPolicy Bypass -File "C:\Windows\Setup\Scripts\
UWScript.ps1"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>8</Order>
<!-- Creates UnattendedWinstall Script Shortcut on
Desktop -->
<Path>powershell.exe -NoProfile -WindowStyle Hidden -
ExecutionPolicy Bypass -File "C:\Windows\Temp\
UWScriptShortcut.ps1"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>9</Order>
<!-- Loads Default User Registry Hive to Make Changes
to it -->
<Path>reg.exe load "HKU\DefaultUser" "C:\Users\Default\
NTUSER.DAT"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>10</Order>
<!-- Add Registry Key to Run User Account Customization
Script -->
<Path>reg.exe add "HKU\DefaultUser\Software\Microsoft\
Windows\CurrentVersion\Runonce" /v "CurrentUser" /t REG_SZ /d
"cmd.exe /c powershell.exe -WindowStyle Hidden -ExecutionPolicy
Bypass -File \"C:\Users\Default\User Customization.ps1\""
/f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>11</Order>
<!-- Unloads Default User Registry Hive. -->
<Path>reg.exe unload "HKU\DefaultUser"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<!-- Cleanup temporary .ps1 and .reg scripts inside C:\
Windows\Temp -->
<Order>12</Order>
<Path>cmd /c del /f /q "C:\Windows\Temp\*.ps1" "C:\
Windows\Temp\*.reg"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>13</Order>
<!-- Deletes Specialize Phase Marker File -->
<Path>cmd.exe /c del /q
"C:\specialize_marker.txt"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<!-- Disable All Network Adapters Temporarily so
Windows Doesn't Update During OOBE -->
<Order>14</Order>
<Path>powershell.exe -NoProfile -WindowStyle Hidden -
ExecutionPolicy Bypass -Command "Get-NetAdapter | Disable-
NetAdapter -Confirm:$false"</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>
<!-- Loads Scripts in File -->
<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>
<!-- Disables User Account Control -->
<Path>reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\
Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t
REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>3</Order>
<!-- Enables Running of PowerShell Scripts -->
<Path>powershell.exe -NoProfile -WindowStyle Hidden -
Command "Set-ExecutionPolicy RemoteSigned -Scope LocalMachine -
Force"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>4</Order>
<!-- Skips Forced Microsoft Account Creation -->
<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>5</Order>
<!-- Runs Script to Enable .NET3.5 from Windows
Installation Media -->
<Path>powershell.exe -NoProfile -WindowStyle Hidden -
ExecutionPolicy Bypass -File "C:\Windows\Temp\DotNet.ps1"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>6</Order>
<!-- Creates Specialize Phase Marker File -->
<Path>cmd.exe /c echo Specialized Setup > "C:\
specialize_marker.txt"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>7</Order>
<!-- Runs Recommended UnattendedWinstall Scripts -->
<Path>powershell.exe -NoProfile -WindowStyle Hidden -
ExecutionPolicy Bypass -File "C:\Windows\Setup\Scripts\
UWScript.ps1"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>8</Order>
<!-- Creates UnattendedWinstall Script Shortcut on
Desktop -->
<Path>powershell.exe -NoProfile -WindowStyle Hidden -
ExecutionPolicy Bypass -File "C:\Windows\Temp\
UWScriptShortcut.ps1"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>9</Order>
<!-- Loads Default User Registry Hive to Make Changes
to it -->
<Path>reg.exe load "HKU\DefaultUser" "C:\Users\Default\
NTUSER.DAT"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>10</Order>
<!-- Add Registry Key to Run User Account Customization
Script -->
<Path>reg.exe add "HKU\DefaultUser\Software\Microsoft\
Windows\CurrentVersion\Runonce" /v "CurrentUser" /t REG_SZ /d
"cmd.exe /c powershell.exe -WindowStyle Hidden -ExecutionPolicy
Bypass -File \"C:\Users\Default\User Customization.ps1\""
/f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>11</Order>
<!-- Unloads Default User Registry Hive. -->
<Path>reg.exe unload "HKU\DefaultUser"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<!-- Cleanup temporary .ps1 and .reg scripts inside C:\
Windows\Temp -->
<Order>12</Order>
<Path>cmd /c del /f /q "C:\Windows\Temp\*.ps1" "C:\
Windows\Temp\*.reg"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>13</Order>
<!-- Deletes Specialize Phase Marker File -->
<Path>cmd.exe /c del /q
"C:\specialize_marker.txt"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<!-- Disable All Network Adapters Temporarily so
Windows Doesn't Update During OOBE -->
<Order>14</Order>
<Path>powershell.exe -NoProfile -WindowStyle Hidden -
ExecutionPolicy Bypass -Command "Get-NetAdapter | Disable-
NetAdapter -Confirm:$false"</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>
<!-- Loads Scripts in File -->
<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>
<!-- Disables User Account Control -->
<Path>reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\
Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t
REG_DWORD /d 0 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>3</Order>
<!-- Enables Running of PowerShell Scripts -->
<Path>powershell.exe -NoProfile -WindowStyle Hidden -
Command "Set-ExecutionPolicy RemoteSigned -Scope LocalMachine -
Force"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>4</Order>
<!-- Skips Forced Microsoft Account Creation -->
<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>5</Order>
<!-- Runs Script to Enable .NET3.5 from Windows
Installation Media -->
<Path>powershell.exe -NoProfile -WindowStyle Hidden -
ExecutionPolicy Bypass -File "C:\Windows\Temp\DotNet.ps1"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>6</Order>
<!-- Creates Specialize Phase Marker File -->
<Path>cmd.exe /c echo Specialized Setup > "C:\
specialize_marker.txt"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>7</Order>
<!-- Runs Recommended UnattendedWinstall Scripts -->
<Path>powershell.exe -NoProfile -WindowStyle Hidden -
ExecutionPolicy Bypass -File "C:\Windows\Setup\Scripts\
UWScript.ps1"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>8</Order>
<!-- Creates UnattendedWinstall Script Shortcut on
Desktop -->
<Path>powershell.exe -NoProfile -WindowStyle Hidden -
ExecutionPolicy Bypass -File "C:\Windows\Temp\
UWScriptShortcut.ps1"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>9</Order>
<!-- Loads Default User Registry Hive to Make Changes
to it -->
<Path>reg.exe load "HKU\DefaultUser" "C:\Users\Default\
NTUSER.DAT"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>10</Order>
<!-- Add Registry Key to Run User Account Customization
Script -->
<Path>reg.exe add "HKU\DefaultUser\Software\Microsoft\
Windows\CurrentVersion\Runonce" /v "CurrentUser" /t REG_SZ /d
"cmd.exe /c powershell.exe -WindowStyle Hidden -ExecutionPolicy
Bypass -File \"C:\Users\Default\User Customization.ps1\""
/f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>11</Order>
<!-- Unloads Default User Registry Hive. -->
<Path>reg.exe unload "HKU\DefaultUser"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<!-- Cleanup temporary .ps1 and .reg scripts inside C:\
Windows\Temp -->
<Order>12</Order>
<Path>cmd /c del /f /q "C:\Windows\Temp\*.ps1" "C:\
Windows\Temp\*.reg"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>13</Order>
<!-- Deletes Specialize Phase Marker File -->
<Path>cmd.exe /c del /q
"C:\specialize_marker.txt"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<!-- Disable All Network Adapters Temporarily so
Windows Doesn't Update During OOBE -->
<Order>14</Order>
<Path>powershell.exe -NoProfile -WindowStyle Hidden -
ExecutionPolicy Bypass -Command "Get-NetAdapter | Disable-
NetAdapter -Confirm:$false"</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>
<settings pass="auditSystem"></settings>
<settings pass="auditUser"></settings>
<settings pass="oobeSystem">
<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>
<!-- Enables Network Adapters After OOBE Completes -->
<Order>1</Order>
<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>
<!-- Enables Network Adapters After OOBE Completes -->
<Order>1</Order>
<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>
<!-- Enables Network Adapters After OOBE Completes -->
<Order>1</Order>
<CommandLine>powershell.exe -NoProfile -WindowStyle
Hidden -ExecutionPolicy Bypass -Command "Get-NetAdapter | Enable-
NetAdapter -Confirm:$false"</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
</component>
</settings>
<Extensions>
<ExtractScript>
param(
[xml] $Document
);
$scriptsDir = 'C:\Windows\Setup\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:\Windows\Temp\DotNet.ps1">
<![CDATA[
function Enable-DotNetFramework {
$sourceFound = $false
$sourceCabFile = ""
if ($cabFile) {
$sourceCabFile = $sxsFolderPath
Write-Host "Found .NET Framework 3.5 CAB file in
folder: $sxsFolderPath" -ForegroundColor Green
$sourceFound = $true
break
}
}
else {
Write-Host "Sources folder not found at
$sxsFolderPath" -ForegroundColor Yellow
}
}
if ($sourceFound) {
$dismCommand = "/Online /Enable-Feature
/FeatureName:NetFx3 /All /LimitAccess /Source:$sourceCabFile"
Write-Host "Executing DISM command: $dismCommand" -
ForegroundColor Yellow
Start-Process -FilePath dism.exe -ArgumentList
$dismCommand -Wait -NoNewWindow
Enable-DotNetFramework
exit
]]>
</File>
<File path="C:\Windows\Setup\Scripts\UWScript.ps1">
<![CDATA[
# Check if script is running as Administrator
If (!([Security.Principal.WindowsPrincipal]
[Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Sec
urity.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
}
}
[StructLayout(LayoutKind.Sequential)]
public struct RECT {
public int Left;
public int Top;
public int Right;
public int Bottom;
}
[DllImport("user32.dll")]
public static extern int GetSystemMetrics(int nIndex);
}
"@
[WindowCentering]::CenterWindow($psWindow)
# Header
function Show-Header {
Clear-Host
Write-Host "============================================" -
ForegroundColor Cyan
Write-Host " UWScript " -
ForegroundColor Yellow
Write-Host "============================================" -
ForegroundColor Cyan
Write-Host ""
Write-Host "NO LIABILITY ACCEPTED, PROCEED WITH CAUTION!" -
ForegroundColor Black -BackgroundColor Red
Write-Host ""
}
# Main Menu
function Show-MainMenu {
Show-Header
Write-Host "Main Menu:" -ForegroundColor Yellow
Write-Host "1. Software & Apps"
Write-Host "2. Privacy & Security"
Write-Host "3. Windows Updates"
Write-Host "4. Optimize Registry"
Write-Host "5. Tasks & Services"
Write-Host "6. Power Settings"
Write-Host "0. Exit"
switch ($choice) {
"1" { Show-SoftwareMenu } # Call the Software & Apps
menu
"2" { Show-PrivacySecurityMenu } # Call the Privacy &
Security menu
"3" { Show-WindowsUpdateMenu } # Call the Windows
Updates menu
"4" { Show-OptimizeRegistryMenu } # Call the Optimize
Registry menu
"5" { Show-TasksServicesMenu } # Call the Tasks &
Services menu
"6" { Show-PowerSettingsMenu } # Call the Power Settings
menu
"0" { $script:loop = $false } # Exit
default {
Write-Host "Invalid selection. Please try again." -
ForegroundColor Red
Start-Sleep -Seconds 1
}
}
}
Write-Host ""
$choice = Read-Host "$instructions"
if ($choice -eq "0") {
return # Return to the previous menu or exit current menu
}
elseif ($actions.ContainsKey($choice)) {
# Execute the corresponding action
& $actions[$choice]
}
else {
Write-Host "Invalid choice. Try again." -ForegroundColor
Red
Start-Sleep -Seconds 1
Show-Menu -menuTitle $menuTitle -options $options -
actions $actions -showHeader:$showHeader
}
}
Try {
Show-Header
Write-Host "Starting download of WinGet installer
using BITS..."
Show-Header
Write-Host "WinGet installer downloaded
successfully."
Show-Header
# Check for internet connection
if (-not (Test-InternetConnection)) {
Show-Header
Write-Host "No internet connection detected. Please
connect to the internet and try again." -BackgroundColor Red
Wait-IfNotSpecialize
return
}
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows
Chat]
"ChatIcon"=dword:00000003
; Disables Cortana
[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Windows
Search]
"AllowCortana"=dword:00000000
if ($defenderStatus -eq 4) {
Show-Header
Write-Host "Windows Defender is permanently disabled." -
ForegroundColor Red
Write-Host "Press 1 to enable Windows Defender."
Write-Host "Note: Enabling Defender using this script
means it cannot be permanently disabled again without
reinstalling Windows with the UnattendedWinstall XML file."
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdBoot]
"Start"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdFilter]
"Start"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdNisDrv]
"Start"=dword:00000003
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdNisSvc]
"Start"=dword:00000003
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinDefend]
"Start"=dword:00000002
"@
Set-Content -Path "$env:TEMP\Enable_Windows_Defender.reg" -
Value $MultilineComment -Force
$path = "$env:TEMP\Enable_Windows_Defender.reg"
(Get-Content $path) -replace "\?", "$" | Out-File $path
Regedit.exe /S "$env:TEMP\Enable_Windows_Defender.reg"
Write-Host "Windows Defender has been enabled." -
ForegroundColor Green
Write-Host "Press any key to return to the main menu."
Read-Host
}
if (-not $isSpecializePhase) {
Show-Header
Write-Host "Applying Recommended Privacy Settings . . ."
}
$MultilineComment = @"
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\
Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}]
"SensorPermissionState"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lfsvc\
Service\Configuration]
"Status"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\Maps]
"AutoUpdateEnabled"=dword:00000000
; Disables Telemetry
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
Policies\DataCollection]
"AllowTelemetry"=dword:00000000
if (-not $isSpecializePhase) {
Show-Header
Write-Host "Recommended Privacy Settings Applied." -
ForegroundColor Green
Wait-IfNotSpecialize
}
}
Show-Header
Write-Host "Applying Default Privacy Settings . . ."
$MultilineComment = @"
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\
Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}]
"SensorPermissionState"=-
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lfsvc\
Service\Configuration]
"Status"=-
[HKEY_LOCAL_MACHINE\SYSTEM\Maps]
"AutoUpdateEnabled"=dword:00000001
if (-not $isSpecializePhase) {
Show-Header
Write-Host "Applying Recommended Windows Update
Settings . . ."
}
$MultilineComment = @"
Windows Registry Editor Version 5.00
if (-not $isSpecializePhase) {
Show-Header
Write-Host "Recommended Windows Update Settings Applied."
-ForegroundColor Green
Wait-IfNotSpecialize
}
}
function Set-DefaultUpdateSettings {
Show-Header
Write-Host "Applying Default Windows Update Settings . . ."
$MultilineComment = @"
Windows Registry Editor Version 5.00
Show-Header
Write-Host "Default Windows Update Settings Applied." -
ForegroundColor Green
Wait-IfNotSpecialize
}
# End of Windows Update Functions
[-HKEY_CLASSES_ROOT\*\shell\TakeOwnership]
[-HKEY_CLASSES_ROOT\*\shell\runas]
[HKEY_CLASSES_ROOT\*\shell\TakeOwnership]
@="Take Ownership"
"Extended"=-
"HasLUAShield"=""
"NoWorkingDirectory"=""
"NeverDefault"=""
[HKEY_CLASSES_ROOT\*\shell\TakeOwnership\command]
@="powershell -windowstyle hidden -command \"Start-Process cmd -
ArgumentList '/c takeown /f \\\"%1\\\" && icacls \\\"%1\\\"
/grant *S-1-3-4:F /t /c /l & pause' -Verb runAs\""
"IsolatedCommand"= "powershell -windowstyle hidden -
command \"Start-Process cmd -ArgumentList '/c takeown
/f \\\"%1\\\" && icacls \\\"%1\\\" /grant *S-1-3-4:F /t /c /l &
pause' -Verb runAs\""
[HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership]
@="Take Ownership"
"AppliesTo"="NOT (System.ItemPathDisplay:=\"C:\\Users\" OR
System.ItemPathDisplay:=\"C:\\ProgramData\" OR
System.ItemPathDisplay:=\"C:\\Windows\" OR
System.ItemPathDisplay:=\"C:\\Windows\\System32\" OR
System.ItemPathDisplay:=\"C:\\Program Files\" OR
System.ItemPathDisplay:=\"C:\\Program Files (x86)\")"
"Extended"=-
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership\command]
@="powershell -windowstyle hidden -command \"$Y = ($null |
choice).Substring(1,1); Start-Process cmd -ArgumentList ('/c
takeown /f \\\"%1\\\" /r /d ' + $Y + ' && icacls \\\"%1\\\"
/grant *S-1-3-4:F /t /c /l /q & pause') -Verb runAs\""
"IsolatedCommand"="powershell -windowstyle hidden -command \"$Y =
($null | choice).Substring(1,1); Start-Process cmd -ArgumentList
('/c takeown /f \\\"%1\\\" /r /d ' + $Y + ' &&
icacls \\\"%1\\\" /grant *S-1-3-4:F /t /c /l /q & pause') -Verb
runAs\""
[HKEY_CLASSES_ROOT\Drive\shell\runas]
@="Take Ownership"
"Extended"=-
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
"AppliesTo"="NOT (System.ItemPathDisplay:=\"C:\\\")"
[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\\\" /r /d y && icacls \"%1\\\"
/grant *S-1-3-4:F /t /c & Pause"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\\\" /r /d y &&
icacls \"%1\\\" /grant *S-1-3-4:F /t /c & Pause"
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows
Chat]
"ChatIcon"=dword:00000003
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\
EnhancedStorageDevices]
"TCGSecurityActivationDisabled"=dword:00000001
; Disables Cortana
[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Windows
Search]
"AllowCortana"=dword:00000000
[HKEY_LOCAL_MACHINE\Software\Microsoft\PolicyManager\default\
WiFi\AllowAutoConnectToWiFiSenseHotspots]
"Value"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\providers\
B5292708-1619-419B-9923-E5D9F3925E71\default\Device\Start]
"ConfigureStartPins"="{ \"pinnedList\": [] }"
"ConfigureStartPins_LastWrite"=dword:00000001
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\
EditionOverrides]
"UserSetting_DisableStartupSound"=dword:00000001
; TROUBLESHOOTING
; disable automatic maintenance
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\
Schedule\Maintenance]
"MaintenanceDisabled"=dword:00000001
; ACCOUNTS
; disable use my sign in info after restart
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
Policies\System]
"DisableAutomaticRestartSignOn"=dword:00000001
; APPS
; disable archive apps
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Appx]
"AllowAutomaticAppArchiving"=dword:00000000
; PERSONALIZATION
; Hides the Meet Now Button on the Taskbar
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
Policies\Explorer]
"HideSCAMeetNow"=dword:00000001
"NoStartMenuMFUprogramsList"=-
"NoInstrumentation"=-
; SYSTEM
; turn on hardware accelerated gpu scheduling
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\
GraphicsDrivers]
"HwSchMode"=dword:00000002
; --OTHER--
; Disable update Microsoft Store apps automatically
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore]
"AutoDownload"=dword:00000002
; UWP APPS
; disable background apps
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\
AppPrivacy]
"LetAppsRunInBackground"=dword:00000002
; disable widgets
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\
NewsAndInterests\AllowNewsAndInterests]
"value"=dword:00000000
; NVIDIA
; enable old nvidia sharpening
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\nvlddmkm\
FTS]
"EnableGR535"=dword:00000000
; OTHER
; remove 3d objects
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-
FF41B59E513A}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\
CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-
9020-FF41B59E513A}]
[HKEY_USERS\.DEFAULT\Control Panel\Mouse]
"MouseSpeed"="0"
"MouseThreshold1"="0"
"MouseThreshold2"="0"
"@
Set-Content -Path "$env:TEMP\
Optimize_LocalMachine_Registry.reg" -Value $MultilineComment -
Force
# edit reg file
$path = "$env:TEMP\Optimize_LocalMachine_Registry.reg"
(Get-Content $path) -replace "\?", "$" | Out-File $path
# import reg file
Regedit.exe /S "$env:TEMP\Optimize_LocalMachine_Registry.reg"
Show-Header
Write-Host "Recommended Local Machine Registry Settings
Applied." -ForegroundColor Green
Wait-IfNotSpecialize
}
function Set-DefaultHKLMRegistry {
# create reg file
$MultilineComment = @"
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows
Chat]
"ChatIcon"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\
EnhancedStorageDevices]
"TCGSecurityActivationDisabled"=-
; Enables Cortana
[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Windows
Search]
"AllowCortana"=-
; Re-enables WiFi-Sense
[HKEY_LOCAL_MACHINE\Software\Microsoft\PolicyManager\default\
WiFi\AllowWiFiHotSpotReporting]
"Value"=dword:00000001
[HKEY_LOCAL_MACHINE\Software\Microsoft\PolicyManager\default\
WiFi\AllowAutoConnectToWiFiSenseHotspots]
"Value"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\providers\
B5292708-1619-419B-9923-E5D9F3925E71\default\Device\Start]
"ConfigureStartPins"=-
"ConfigureStartPins_LastWrite"=-
[-HKEY_CLASSES_ROOT\*\shell\runas]
[-HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership]
[-HKEY_CLASSES_ROOT\Drive\shell\runas]
; sleep
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\FlyoutMenuSettings]
; startup sound
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\
Authentication\LogonUI\BootAnimation]
"DisableStartupSound"=dword:00000000
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\
EditionOverrides]
"UserSetting_DisableStartupSound"=dword:00000000
; remote assistance
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Remote
Assistance]
"fAllowToGetHelp"=dword:00000001
; TROUBLESHOOTING
; automatic maintenance
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\
Schedule\Maintenance]
"MaintenanceDisabled"=-
; ACCOUNTS
; use my sign in info after restart
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
Policies\System]
"DisableAutomaticRestartSignOn"=-
; APPS
; archive apps
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Appx]
"AllowAutomaticAppArchiving"=-
; PERSONALIZATION
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
Themes\Personalize]
; SYSTEM
; hardware accelerated gpu scheduling
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\
GraphicsDrivers]
"HwSchMode"=-
; storage sense
[-HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\
StorageSense]
; --OTHER--
; Enable update Microsoft Store apps automatically
[-HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore]
; --CAN'T DO NATIVELY--
; UWP APPS
; background apps
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\
AppPrivacy]
"LetAppsRunInBackground"=-
; widgets
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\
NewsAndInterests\AllowNewsAndInterests]
"value"=dword:00000001
; NVIDIA
; old nvidia sharpening
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\nvlddmkm\
FTS]
"EnableGR535"=dword:00000001
; OTHER
; 3d objects
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-
FF41B59E513A}]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\
CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-
9020-FF41B59E513A}]
[HKEY_USERS\.DEFAULT\Control Panel\Mouse]
"MouseSpeed"="1"
"MouseThreshold1"="6"
"MouseThreshold2"="10"
"@
Set-Content -Path "$env:TEMP\
Restore_LocalMachine_Registry.reg" -Value $MultilineComment -
Force
# edit reg file
$path = "$env:TEMP\Restore_LocalMachine_Registry.reg"
(Get-Content $path) -replace "\?", "$" | Out-File
$path
# import reg file
Regedit.exe /S "$env:TEMP\Restore_LocalMachine_Registry.reg"
Show-Header
Write-Host "Default Local Machine Registry Settings Applied."
-ForegroundColor Green
Wait-IfNotSpecialize
}
function Set-RecommendedHKCURegistry {
Clear-Host
Write-Host "Optimizing User Registry . . ."
$MultilineComment = @"
Windows Registry Editor Version 5.00
; EASE OF ACCESS
; disable narrator
[HKEY_CURRENT_USER\Software\Microsoft\Narrator\NoRoam]
"DuckAudio"=dword:00000000
"WinEnterLaunchEnabled"=dword:00000000
"ScriptingEnabled"=dword:00000000
"OnlineServicesEnabled"=dword:00000000
"EchoToggleKeys"=dword:00000000
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Narrator\NarratorHome]
"MinimizeType"=dword:00000000
"AutoStart"=dword:00000000
[HKEY_CURRENT_USER\Control Panel\Accessibility]
"Sound on Activation"=dword:00000000
"Warning Sounds"=dword:00000000
[HKEY_CURRENT_USER\Control Panel\Accessibility\HighContrast]
"Flags"="4194"
[HKEY_CURRENT_USER\Control Panel\Accessibility\MouseKeys]
"Flags"="130"
"MaximumSpeed"="39"
"TimeToMaximumSpeed"="3000"
[HKEY_CURRENT_USER\Control Panel\Accessibility\StickyKeys]
"Flags"="2"
[HKEY_CURRENT_USER\Control Panel\Accessibility\ToggleKeys]
"Flags"="34"
[HKEY_CURRENT_USER\Control Panel\Accessibility\SoundSentry]
"Flags"="0"
"FSTextEffect"="0"
"TextEffect"="0"
"WindowsEffect"="0"
[HKEY_CURRENT_USER\Control Panel\Accessibility\SlateLaunch]
"ATapp"=""
"LaunchAT"=dword:00000000
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Speech_OneCore\Settings\
VoiceActivation\UserPreferenceForAllApps]
"AgentActivationLastUsed"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\InputPersonalization\
TrainedDataStore]
"HarvestContacts"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Personalization\Settings]
"AcceptedPrivacyPolicy"=dword:00000000
; SEARCH
; disable search highlights
; disable search history
; disable safe search
; disable cloud content search for work or school account
; disable cloud content search for microsoft account
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
SearchSettings]
"IsDynamicSearchBoxEnabled"=dword:00000000
"IsDeviceSearchHistoryEnabled"=dword:00000000
"SafeSearchMode"=dword:00000000
"IsAADCloudSearchEnabled"=dword:00000000
"IsMSACloudSearchEnabled"=dword:00000000
; EASE OF ACCESS
; disable magnifier settings
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\ScreenMagnifier]
"FollowCaret"=dword:00000000
"FollowNarrator"=dword:00000000
"FollowMouse"=dword:00000000
"FollowFocus"=dword:00000000
; GAMING
; disable game bar
[HKEY_CURRENT_USER\System\GameConfigStore]
"GameDVR_Enabled"=dword:00000000
; other settings
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
GameDVR]
"AppCaptureEnabled"=dword:00000000
"AudioEncodingBitrate"=dword:0001f400
"AudioCaptureEnabled"=dword:00000000
"CustomVideoEncodingBitrate"=dword:003d0900
"CustomVideoEncodingHeight"=dword:000002d0
"CustomVideoEncodingWidth"=dword:00000500
"HistoricalBufferLength"=dword:0000001e
"HistoricalBufferLengthUnit"=dword:00000001
"HistoricalCaptureEnabled"=dword:00000000
"HistoricalCaptureOnBatteryAllowed"=dword:00000001
"HistoricalCaptureOnWirelessDisplayAllowed"=dword:00000001
"MaximumRecordLength"=hex(b):00,D0,88,C3,10,00,00,00
"VideoEncodingBitrateMode"=dword:00000002
"VideoEncodingResolutionMode"=dword:00000002
"VideoEncodingFrameRateMode"=dword:00000000
"EchoCancellationEnabled"=dword:00000001
"CursorCaptureEnabled"=dword:00000000
"VKToggleGameBar"=dword:00000000
"VKMToggleGameBar"=dword:00000000
"VKSaveHistoricalVideo"=dword:00000000
"VKMSaveHistoricalVideo"=dword:00000000
"VKToggleRecording"=dword:00000000
"VKMToggleRecording"=dword:00000000
"VKTakeScreenshot"=dword:00000000
"VKMTakeScreenshot"=dword:00000000
"VKToggleRecordingIndicator"=dword:00000000
"VKMToggleRecordingIndicator"=dword:00000000
"VKToggleMicrophoneCapture"=dword:00000000
"VKMToggleMicrophoneCapture"=dword:00000000
"VKToggleCameraCapture"=dword:00000000
"VKMToggleCameraCapture"=dword:00000000
"VKToggleBroadcast"=dword:00000000
"VKMToggleBroadcast"=dword:00000000
"MicrophoneCaptureEnabled"=dword:00000000
"SystemAudioGain"=hex(b):10,27,00,00,00,00,00,00
"MicrophoneGain"=hex(b):10,27,00,00,00,00,00,00
; PERSONALIZATION
; dark theme
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\
Themes\Personalize]
"AppsUseLightTheme"=dword:00000000
"SystemUsesLightTheme"=dword:00000000
"EnableTransparency"=dword:00000001
; DEVICES
; disable let windows manage my default printer
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\
Windows]
"LegacyDefaultPrinterMode"=dword:00000001
; SYSTEM
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\DWM]
"UseDpiScaling"=dword:00000000
; disable notifications
; Disable Notifications on Lock Screen
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
PushNotifications]
"ToastEnabled"=dword:00000000
"LockScreenToastEnabled"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Notifications\Settings\
Windows.SystemToast.SecurityAndMaintenance]
"Enabled"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Notifications\Settings\
windows.immersivecontrolpanel_cw5n1h2txyewy!
microsoft.windows.immersivecontrolpanel]
"Enabled"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Notifications\Settings\Windows.SystemToast.CapabilityAccess]
"Enabled"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Notifications\Settings\Windows.SystemToast.StartupApp]
"Enabled"=dword:00000000
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\
UserProfileEngagement]
"ScoobeSystemSettingEnabled"=dword:00000000
; UWP Apps
; disable windows input experience preload
[HKEY_CURRENT_USER\Software\Microsoft\input]
"IsInputAppPreloadEnabled"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Dsh]
"IsPrelaunchEnabled"=dword:00000000
; disable copilot
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\
WindowsCopilot]
"TurnOffWindowsCopilot"=dword:00000001
; OTHER
; remove gallery
[HKEY_CURRENT_USER\Software\Classes\CLSID\{e88865ea-0e1c-4e20-
9aa6-edcd0212c87c}]
"System.IsPinnedToNameSpaceTree"=dword:00000000
function Set-DefaultHKCURegistry {
Clear-Host
Write-Host "Restoring User Default Registry Settings . . ."
$MultilineComment = @"
Windows Registry Editor Version 5.00
; narrator settings
[HKEY_CURRENT_USER\Software\Microsoft\Narrator]
"NarratorCursorHighlight"=-
"CoupleNarratorCursorKeyboard"=-
"IntonationPause"=-
"ReadHints"=-
"ErrorNotificationType"=-
"EchoChars"=-
"EchoWords"=-
[-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Narrator\NarratorHome]
[HKEY_CURRENT_USER\Control Panel\Accessibility]
"Sound on Activation"=-
"Warning Sounds"=-
[HKEY_CURRENT_USER\Control Panel\Accessibility\HighContrast]
"Flags"="126"
[HKEY_CURRENT_USER\Control Panel\Accessibility\MouseKeys]
"Flags"="62"
"MaximumSpeed"="80"
"TimeToMaximumSpeed"="3000"
[HKEY_CURRENT_USER\Control Panel\Accessibility\StickyKeys]
"Flags"="510"
[HKEY_CURRENT_USER\Control Panel\Accessibility\ToggleKeys]
"Flags"="62"
[HKEY_CURRENT_USER\Control Panel\Accessibility\SoundSentry]
"Flags"="2"
"FSTextEffect"="0"
"TextEffect"="0"
"WindowsEffect"="1"
[HKEY_CURRENT_USER\Control Panel\Accessibility\SlateLaunch]
"ATapp"="narrator"
"LaunchAT"=dword:00000001
; voice activation
[-HKEY_CURRENT_USER\Software\Microsoft\Speech_OneCore\Settings]
; other devices
[-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\
CapabilityAccessManager\ConsentStore\bluetoothSync]
; let websites show me locally relevant content by accessing my
language list
[HKEY_CURRENT_USER\Control Panel\International\User Profile]
"HttpAcceptLanguageOptOut"=-
[HKEY_CURRENT_USER\Software\Microsoft\InputPersonalization\
TrainedDataStore]
"HarvestContacts"=dword:00000001
[HKEY_CURRENT_USER\Software\Microsoft\Personalization\Settings]
"AcceptedPrivacyPolicy"=dword:00000001
; feedback frequency
[-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Siuf]
; SEARCH
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
SearchSettings]
"IsDynamicSearchBoxEnabled"=-
"IsDeviceSearchHistoryEnabled"=-
"SafeSearchMode"=-
"IsAADCloudSearchEnabled"=-
"IsMSACloudSearchEnabled"=-
; EASE OF ACCESS
; magnifier settings
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\ScreenMagnifier]
"FollowCaret"=-
"FollowNarrator"=-
"FollowMouse"=-
"FollowFocus"=-
; GAMING
; game bar
[HKEY_CURRENT_USER\System\GameConfigStore]
"GameDVR_Enabled"=dword:00000000
; other settings
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
GameDVR]
"AppCaptureEnabled"=-
"AudioEncodingBitrate"=-
"AudioCaptureEnabled"=-
"CustomVideoEncodingBitrate"=-
"CustomVideoEncodingHeight"=-
"CustomVideoEncodingWidth"=-
"HistoricalBufferLength"=-
"HistoricalBufferLengthUnit"=-
"HistoricalCaptureEnabled"=-
"HistoricalCaptureOnBatteryAllowed"=-
"HistoricalCaptureOnWirelessDisplayAllowed"=-
"MaximumRecordLength"=-
"VideoEncodingBitrateMode"=-
"VideoEncodingResolutionMode"=-
"VideoEncodingFrameRateMode"=-
"EchoCancellationEnabled"=-
"CursorCaptureEnabled"=-
"VKToggleGameBar"=-
"VKMToggleGameBar"=-
"VKSaveHistoricalVideo"=-
"VKMSaveHistoricalVideo"=-
"VKToggleRecording"=-
"VKMToggleRecording"=-
"VKTakeScreenshot"=-
"VKMTakeScreenshot"=-
"VKToggleRecordingIndicator"=-
"VKMToggleRecordingIndicator"=-
"VKToggleMicrophoneCapture"=-
"VKMToggleMicrophoneCapture"=-
"VKToggleCameraCapture"=-
"VKMToggleCameraCapture"=-
"VKToggleBroadcast"=-
"VKMToggleBroadcast"=-
"MicrophoneCaptureEnabled"=-
"SystemAudioGain"=-
"MicrophoneGain"=-
; PERSONALIZATION
; light theme
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\
Themes\Personalize]
"AppsUseLightTheme"=dword:00000001
"SystemUsesLightTheme"=dword:00000001
[-HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Explorer]
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Policies\Explorer]
; meet now
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Policies\Explorer]
; DEVICES
; let windows manage my default printer
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\
Windows]
"LegacyDefaultPrinterMode"=dword:ffffffff
; SYSTEM
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\DWM]
"UseDpiScaling"=-
; Notification defaults
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
PushNotifications]
"ToastEnabled"=-
"LockScreenToastEnabled"=-
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Notifications\Settings]
"NOC_GLOBAL_SETTING_ALLOW_NOTIFICATION_SOUND"=-
"NOC_GLOBAL_SETTING_ALLOW_TOASTS_ABOVE_LOCK"=-
"NOC_GLOBAL_SETTING_ALLOW_CRITICAL_TOASTS_ABOVE_LOCK"=-
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Notifications\Settings\
Windows.SystemToast.SecurityAndMaintenance]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Notifications\Settings\
windows.immersivecontrolpanel_cw5n1h2txyewy!
microsoft.windows.immersivecontrolpanel]
"Enabled"=-
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Notifications\Settings\Windows.SystemToast.CapabilityAccess]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Notifications\Settings\Windows.SystemToast.StartupApp]
"Enabled"=dword:00000000
[-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\
UserProfileEngagement]
; suggested actions
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
SmartActionPlatform\SmartClipboard]
"Disabled"=-
; UWP APPS
; disable windows input experience preload
[HKEY_CURRENT_USER\Software\Microsoft\input]
"IsInputAppPreloadEnabled"=-
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Dsh]
; copilot
[-HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\
WindowsCopilot]
; context menu
[-HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-
a509-50c905bae2a2}]
"@
Set-Content -Path "$env:TEMP\Restore_User_Registry.reg" -
Value $MultilineComment -Force
Regedit.exe /S "$env:TEMP\Restore_User_Registry.reg"
Show-Header
Write-Host "Default User Registry Settings Applied." -
ForegroundColor Green
Wait-IfNotSpecialize
}
# End of Registry Optimizations
Show-Header
Write-Host "Service startup types updated successfully." -
ForegroundColor Green
Wait-IfNotSpecialize
}
function Set-DefaultServices {
# Get all services that are not currently set to Automatic
and revert them
$allServices = Get-Service | Where-Object { $_.StartType -ne
'Automatic' }
$successCount = 0
foreach ($service in $allServices) {
try {
Show-Header
Write-Host "Setting services to Automatic where
permissions are allowed. Please wait . . ."
# Set the service startup type to Automatic using
Set-Service
Set-Service -Name $service.Name -StartupType
Automatic 2>&1 | Out-Null
function Disable-ScheduledTasks {
# Define the list of scheduled tasks to disable
$scheduledTasks = @(
"Microsoft\Windows\Application Experience\Microsoft
Compatibility Appraiser",
"Microsoft\Windows\Application Experience\
ProgramDataUpdater",
"Microsoft\Windows\Autochk\Proxy",
"Microsoft\Windows\Customer Experience Improvement
Program\Consolidator",
"Microsoft\Windows\Customer Experience Improvement
Program\UsbCeip",
"Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-
DiskDiagnosticDataCollector",
"Microsoft\Windows\Feedback\Siuf\DmClient",
"Microsoft\Windows\Feedback\Siuf\
DmClientOnScenarioDownload",
"Microsoft\Windows\Windows Error Reporting\
QueueReporting",
"Microsoft\Windows\Application Experience\MareBackup",
"Microsoft\Windows\Application Experience\
StartupAppTask",
"Microsoft\Windows\Application Experience\
PcaPatchDbTask",
"Microsoft\Windows\Maps\MapsUpdateTask"
)
$successCount = 0
foreach ($task in $scheduledTasks) {
try {
# Disable the task without wildcards
schtasks /Change /TN $task /Disable 2>&1 | Out-Null
$successCount++
}
catch {
# Silently continue if a task fails
continue
}
}
Show-Header
Write-Host "Successfully disabled unneeded scheduled tasks."
-ForegroundColor Green
Wait-IfNotSpecialize
}
function Enable-ScheduledTasks {
# Define the list of scheduled tasks to enable (same as those
to disable)
$scheduledTasks = @(
"Microsoft\Windows\Application Experience\Microsoft
Compatibility Appraiser",
"Microsoft\Windows\Application Experience\
ProgramDataUpdater",
"Microsoft\Windows\Autochk\Proxy",
"Microsoft\Windows\Customer Experience Improvement
Program\Consolidator",
"Microsoft\Windows\Customer Experience Improvement
Program\UsbCeip",
"Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-
DiskDiagnosticDataCollector",
"Microsoft\Windows\Feedback\Siuf\DmClient",
"Microsoft\Windows\Feedback\Siuf\
DmClientOnScenarioDownload",
"Microsoft\Windows\Windows Error Reporting\
QueueReporting",
"Microsoft\Windows\Application Experience\MareBackup",
"Microsoft\Windows\Application Experience\
StartupAppTask",
"Microsoft\Windows\Application Experience\
PcaPatchDbTask",
"Microsoft\Windows\Maps\MapsUpdateTask"
)
$successCount = 0
foreach ($task in $scheduledTasks) {
try {
# Disable the task without wildcards
schtasks /Change /TN $task /Disable 2>&1 | Out-Null
$successCount++
}
catch {
# Silently continue if a task fails
continue
}
}
Show-Header
Write-Host "Successfully Enabled Default scheduled tasks." -
ForegroundColor Green
Wait-IfNotSpecialize
}
# End of Tasks and Services Functions
# Registry modifications
$regChanges = @(
'HKLM\SYSTEM\CurrentControlSet\Control\Power /v
HibernateEnabled /t REG_DWORD /d 0', # Disables hibernate
'HKLM\SYSTEM\CurrentControlSet\Control\Power /v
HibernateEnabledDefault /t REG_DWORD /d 0', # Disables default
hibernate settings
'HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\
FlyoutMenuSettings /v ShowLockOption /t REG_DWORD /d 0', # Hides
the Lock option from the Power menu
'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
FlyoutMenuSettings /v ShowSleepOption /t REG_DWORD /d 0', # Hides
the Sleep option from the Power menu
'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\
Power /v HiberbootEnabled /t REG_DWORD /d 0', # Disables Fast
Startup (Hiberboot)
'HKLM\SYSTEM\ControlSet001\Control\Power\PowerSettings\
54533251-82be-4824-96c1-47b60b740d00\0cc5b647-c1df-4637-891a-
dec35c318583 /v ValueMax /t REG_DWORD /d 0', # Unparks CPU cores
by setting the maximum processor state
'HKLM\SYSTEM\CurrentControlSet\Control\Power\
PowerThrottling /v PowerThrottlingOff /t REG_DWORD /d 1', #
Disables power throttling
'HKLM\System\ControlSet001\Control\Power\PowerSettings\
2a737441-1930-4402-8d77-b2bebba308a3\0853a681-27c8-4100-a2fd-
82013e970683 /v Attributes /t REG_DWORD /d 2', # Unhides "Hub
Selective Suspend Timeout"
'HKLM\System\ControlSet001\Control\Power\PowerSettings\
2a737441-1930-4402-8d77-b2bebba308a3\d4e98f31-5ffe-4ce1-be31-
1b38b384c009 /v Attributes /t REG_DWORD /d 2' # Unhides "USB 3
Link Power Management"
)
if (-not $isSpecializePhase) {
Show-Header
Write-Host "Recommended Power Settings Applied." -
ForegroundColor Green
Wait-IfNotSpecialize
return
}
}
function Set-DefaultPowerSettings {
Clear-Host
# Restore default power plans and enable hibernate
powercfg -restoredefaultschemes
cmd /c "powercfg /hibernate on >nul 2>&1"
cmd /c "reg add `"HKLM\SYSTEM\CurrentControlSet\Control\
Power`" /v `"HibernateEnabledDefault`" /t REG_DWORD /d `"1`" /f
>nul 2>&1"
# Registry modifications
$regChanges = @(
'HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\
FlyoutMenuSettings /v ShowLockOption /t REG_DWORD /d 1',
'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
FlyoutMenuSettings /v ShowSleepOption /t REG_DWORD /d 1',
'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\
Power /v HiberbootEnabled /t REG_DWORD /d 1',
'HKLM\SYSTEM\ControlSet001\Control\Power\PowerSettings\
54533251-82be-4824-96c1-47b60b740d00\0cc5b647-c1df-4637-891a-
dec35c318583 /v ValueMax /t REG_DWORD /d 100',
'HKLM\System\ControlSet001\Control\Power\PowerSettings\
2a737441-1930-4402-8d77-b2bebba308a3\0853a681-27c8-4100-a2fd-
82013e970683 /v Attributes /t REG_DWORD /d 1',
'HKLM\System\ControlSet001\Control\Power\PowerSettings\
2a737441-1930-4402-8d77-b2bebba308a3\d4e98f31-5ffe-4ce1-be31-
1b38b384c009 /v Attributes /t REG_DWORD /d 1'
)
Show-Header
Write-Host "Default Power Settings Applied." -ForegroundColor
Green
Wait-IfNotSpecialize
return
}
# End of Power Settings Functions
# Stop explorer.exe
Stop-Process -Name explorer -Force
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="0" ResizeBorderThickness="0"
GlassFrameThickness="0"/>
</WindowChrome.WindowChrome>
<Window.Resources>
<!-- Button style when enabled -->
<Style x:Key="PrimaryButtonStyle" TargetType="Button">
<Setter Property="Background" Value="#FFDE00"/> <!--
Your primary yellow -->
<Setter Property="Foreground" Value="Black"/> <!--
Contrast text color -->
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="FontFamily" Value="Futura"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Padding" Value="10,5"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding
Background}" CornerRadius="5">
<ContentPresenter
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<!-- Hover effect -->
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Background"
Value="#FFE533"/> <!-- Lighter yellow on hover -->
</Trigger>
<!-- Disabled state -->
<Trigger Property="IsEnabled"
Value="False">
<Setter Property="Background"
Value="#FFEB99"/> <!-- Lighter yellow for disabled -->
<Setter Property="Foreground"
Value="LightGray"/> <!-- Lighter grey text for disabled -->
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<StackPanel Orientation="Vertical"
Margin="32,97,32,0" VerticalAlignment="Top" Grid.Row="0"
Height="58">
<TextBlock x:Name="StatusMessage"
Text="Recommended User settings have been applied successfully ✓"
FontSize="20"/>
<TextBlock Width="634" Text="Visit 'C:\Windows\
Setup\Scripts' to Reapply or Revert Settings." FontSize="16"
FontStyle="Italic" Height="22" HorizontalAlignment="Left"
Margin="0,0,124,-34"/>
</StackPanel>
# Load XAML
Add-Type -AssemblyName PresentationFramework
[xml]$xamlParsed = $xaml
$xamlWindow = [Windows.Markup.XamlReader]::Load((New-Object
System.Xml.XmlNodeReader $xamlParsed))
# Uninstall Copilot
Get-AppxPackage -Name 'Microsoft.Copilot' | Remove-AppxPackage
Get-AppxPackage -Name 'Microsoft.Windows.Ai.Copilot.Provider' |
Remove-AppxPackage
$MultilineComment = @"
Windows Registry Editor Version 5.00
; EASE OF ACCESS
; disable narrator
[HKEY_CURRENT_USER\Software\Microsoft\Narrator\NoRoam]
"DuckAudio"=dword:00000000
"WinEnterLaunchEnabled"=dword:00000000
"ScriptingEnabled"=dword:00000000
"OnlineServicesEnabled"=dword:00000000
"EchoToggleKeys"=dword:00000000
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Narrator\NarratorHome]
"MinimizeType"=dword:00000000
"AutoStart"=dword:00000000
[HKEY_CURRENT_USER\Control Panel\Accessibility]
"Sound on Activation"=dword:00000000
"Warning Sounds"=dword:00000000
[HKEY_CURRENT_USER\Control Panel\Accessibility\HighContrast]
"Flags"="4194"
[HKEY_CURRENT_USER\Control Panel\Accessibility\MouseKeys]
"Flags"="130"
"MaximumSpeed"="39"
"TimeToMaximumSpeed"="3000"
[HKEY_CURRENT_USER\Control Panel\Accessibility\StickyKeys]
"Flags"="2"
[HKEY_CURRENT_USER\Control Panel\Accessibility\ToggleKeys]
"Flags"="34"
[HKEY_CURRENT_USER\Control Panel\Accessibility\SoundSentry]
"Flags"="0"
"FSTextEffect"="0"
"TextEffect"="0"
"WindowsEffect"="0"
[HKEY_CURRENT_USER\Control Panel\Accessibility\SlateLaunch]
"ATapp"=""
"LaunchAT"=dword:00000000
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Speech_OneCore\Settings\
VoiceActivation\UserPreferenceForAllApps]
"AgentActivationLastUsed"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Personalization\Settings]
"AcceptedPrivacyPolicy"=dword:00000000
; SEARCH
; disable search highlights
; disable search history
; disable safe search
; disable cloud content search for work or school account
; disable cloud content search for microsoft account
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
SearchSettings]
"IsDynamicSearchBoxEnabled"=dword:00000000
"IsDeviceSearchHistoryEnabled"=dword:00000000
"SafeSearchMode"=dword:00000000
"IsAADCloudSearchEnabled"=dword:00000000
"IsMSACloudSearchEnabled"=dword:00000000
; EASE OF ACCESS
; disable magnifier settings
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\ScreenMagnifier]
"FollowCaret"=dword:00000000
"FollowNarrator"=dword:00000000
"FollowMouse"=dword:00000000
"FollowFocus"=dword:00000000
; GAMING
; disable game bar
[HKEY_CURRENT_USER\System\GameConfigStore]
"GameDVR_Enabled"=dword:00000000
; other settings
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
GameDVR]
"AppCaptureEnabled"=dword:00000000
"AudioEncodingBitrate"=dword:0001f400
"AudioCaptureEnabled"=dword:00000000
"CustomVideoEncodingBitrate"=dword:003d0900
"CustomVideoEncodingHeight"=dword:000002d0
"CustomVideoEncodingWidth"=dword:00000500
"HistoricalBufferLength"=dword:0000001e
"HistoricalBufferLengthUnit"=dword:00000001
"HistoricalCaptureEnabled"=dword:00000000
"HistoricalCaptureOnBatteryAllowed"=dword:00000001
"HistoricalCaptureOnWirelessDisplayAllowed"=dword:00000001
"MaximumRecordLength"=hex(b):00,D0,88,C3,10,00,00,00
"VideoEncodingBitrateMode"=dword:00000002
"VideoEncodingResolutionMode"=dword:00000002
"VideoEncodingFrameRateMode"=dword:00000000
"EchoCancellationEnabled"=dword:00000001
"CursorCaptureEnabled"=dword:00000000
"VKToggleGameBar"=dword:00000000
"VKMToggleGameBar"=dword:00000000
"VKSaveHistoricalVideo"=dword:00000000
"VKMSaveHistoricalVideo"=dword:00000000
"VKToggleRecording"=dword:00000000
"VKMToggleRecording"=dword:00000000
"VKTakeScreenshot"=dword:00000000
"VKMTakeScreenshot"=dword:00000000
"VKToggleRecordingIndicator"=dword:00000000
"VKMToggleRecordingIndicator"=dword:00000000
"VKToggleMicrophoneCapture"=dword:00000000
"VKMToggleMicrophoneCapture"=dword:00000000
"VKToggleCameraCapture"=dword:00000000
"VKMToggleCameraCapture"=dword:00000000
"VKToggleBroadcast"=dword:00000000
"VKMToggleBroadcast"=dword:00000000
"MicrophoneCaptureEnabled"=dword:00000000
"SystemAudioGain"=hex(b):10,27,00,00,00,00,00,00
"MicrophoneGain"=hex(b):10,27,00,00,00,00,00,00
; PERSONALIZATION
; dark theme
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\
Themes\Personalize]
"AppsUseLightTheme"=dword:00000000
"SystemUsesLightTheme"=dword:00000000
"EnableTransparency"=dword:00000001
; DEVICES
; disable let windows manage my default printer
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\
Windows]
"LegacyDefaultPrinterMode"=dword:00000001
; SYSTEM
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\DWM]
"UseDpiScaling"=dword:00000000
; disable notifications
; Disable Notifications on Lock Screen
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
PushNotifications]
"ToastEnabled"=dword:00000000
"LockScreenToastEnabled"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Notifications\Settings\
windows.immersivecontrolpanel_cw5n1h2txyewy!
microsoft.windows.immersivecontrolpanel]
"Enabled"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Notifications\Settings\Windows.SystemToast.CapabilityAccess]
"Enabled"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Notifications\Settings\Windows.SystemToast.StartupApp]
"Enabled"=dword:00000000
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\
UserProfileEngagement]
"ScoobeSystemSettingEnabled"=dword:00000000
; UWP Apps
; disable windows input experience preload
[HKEY_CURRENT_USER\Software\Microsoft\input]
"IsInputAppPreloadEnabled"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Dsh]
"IsPrelaunchEnabled"=dword:00000000
; disable copilot
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\
WindowsCopilot]
"TurnOffWindowsCopilot"=dword:00000001
; OTHER
; remove gallery
[HKEY_CURRENT_USER\Software\Classes\CLSID\{e88865ea-0e1c-4e20-
9aa6-edcd0212c87c}]
"System.IsPinnedToNameSpaceTree"=dword:00000000
; Cleans up Taskbar
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Explorer\Taskband]
"FavoritesRemovedChanges"=dword:00000003
"FavoritesResolve"=hex:31,03,00,00,4c,00,00,00,01,14,02,00,00,00,
00,00,c0,00,\
00,00,00,00,00,46,83,00,80,00,20,00,00,00,be,33,35,e7,d1,24,db,
01,be,33,35,\
e7,d1,24,db,01,25,b3,7a,4d,05,84,da,01,97,01,00,00,00,00,00,00,
01,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,a0,01,3a,00,1f,80,c8,27,34,
1f,10,5c,10,\
42,aa,03,2e,e4,52,87,d6,68,26,00,01,00,26,00,ef,be,12,00,00,00,
85,35,2b,d7,\
d1,24,db,01,9b,e4,33,e7,d1,24,db,01,ab,5a,34,e7,d1,24,db,01,14,
00,56,00,31,\
00,00,00,00,00,56,59,b9,b3,11,00,54,61,73,6b,42,61,72,00,40,00,
09,00,04,00,\
ef,be,56,59,b9,b3,56,59,b9,b3,2e,00,00,00,f2,69,01,00,00,00,04,
00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,ef,80,fc,00,54,00,61,00,73,00,
6b,00,42,00,\
61,00,72,00,00,00,16,00,0e,01,32,00,97,01,00,00,81,58,c4,3a,20,
00,46,49,4c,\
45,45,58,7e,31,2e,4c,4e,4b,00,00,7c,00,09,00,04,00,ef,be,56,59,
b9,b3,56,59,\
b9,b3,2e,00,00,00,c3,6a,01,00,00,00,02,00,00,00,00,00,00,00,00,
00,52,00,00,\
00,00,00,db,dc,91,00,46,00,69,00,6c,00,65,00,20,00,45,00,78,00,
70,00,6c,00,\
6f,00,72,00,65,00,72,00,2e,00,6c,00,6e,00,6b,00,00,00,40,00,73,
00,68,00,65,\
00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,
32,00,32,00,\
30,00,36,00,37,00,00,00,1c,00,22,00,00,00,1e,00,ef,be,02,00,55,
00,73,00,65,\
00,72,00,50,00,69,00,6e,00,6e,00,65,00,64,00,00,00,1c,00,12,00,
00,00,2b,00,\
ef,be,7c,4c,37,e7,d1,24,db,01,1c,00,42,00,00,00,1d,00,ef,be,02,
00,4d,00,69,\
00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,2e,00,57,00,69,00,
6e,00,64,00,\
6f,00,77,00,73,00,2e,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,
00,72,00,00,\
00,1c,00,00,00,9a,00,00,00,1c,00,00,00,01,00,00,00,1c,00,00,00,
2d,00,00,00,\
00,00,00,00,99,00,00,00,11,00,00,00,03,00,00,00,0e,76,ea,84,10,
00,00,00,00,\
43,3a,5c,55,73,65,72,73,5c,6d,65,6d,5c,41,70,70,44,61,74,61,5c,
52,6f,61,6d,\
69,6e,67,5c,4d,69,63,72,6f,73,6f,66,74,5c,49,6e,74,65,72,6e,65,
74,20,45,78,\
70,6c,6f,72,65,72,5c,51,75,69,63,6b,20,4c,61,75,6e,63,68,5c,55,
73,65,72,20,\
50,69,6e,6e,65,64,5c,54,61,73,6b,42,61,72,5c,46,69,6c,65,20,45,
78,70,6c,6f,\
72,65,72,2e,6c,6e,6b,00,00,60,00,00,00,03,00,00,a0,58,00,00,00,
00,00,00,00,\
64,65,73,6b,74,6f,70,2d,6e,76,6a,67,69,71,33,00,1e,48,b8,ac,e6,
93,44,44,85,\
d1,06,17,eb,52,3b,ea,cc,41,5d,b0,c4,90,ef,11,b9,08,00,0c,29,5b,
06,9a,1e,48,\
b8,ac,e6,93,44,44,85,d1,06,17,eb,52,3b,ea,cc,41,5d,b0,c4,90,ef,
11,b9,08,00,\
0c,29,5b,06,9a,45,00,00,00,09,00,00,a0,39,00,00,00,31,53,50,53,
b1,16,6d,44,\
ad,8d,70,48,a7,48,40,2e,a4,3d,78,8c,1d,00,00,00,68,00,00,00,00,
48,00,00,00,\
d4,d9,2d,27,b2,34,c5,4f,ad,3b,78,a5,c4,f6,71,2d,00,00,00,00,00,
00,00,00,00,\
00,00,00
"Favorites"=hex:00,a4,01,00,00,3a,00,1f,80,c8,27,34,1f,10,5c,10,4
2,aa,03,2e,e4,\
52,87,d6,68,26,00,01,00,26,00,ef,be,12,00,00,00,85,35,2b,d7,d1,
24,db,01,9b,\
e4,33,e7,d1,24,db,01,ab,5a,34,e7,d1,24,db,01,14,00,56,00,31,00,
00,00,00,00,\
56,59,b9,b3,11,00,54,61,73,6b,42,61,72,00,40,00,09,00,04,00,ef,
be,56,59,b9,\
b3,56,59,b9,b3,2e,00,00,00,f2,69,01,00,00,00,04,00,00,00,00,00,
00,00,00,00,\
00,00,00,00,00,00,ef,80,fc,00,54,00,61,00,73,00,6b,00,42,00,61,
00,72,00,00,\
00,16,00,12,01,32,00,97,01,00,00,81,58,c4,3a,20,00,46,49,4c,45,
45,58,7e,31,\
2e,4c,4e,4b,00,00,7c,00,09,00,04,00,ef,be,56,59,b9,b3,56,59,b9,
b3,2e,00,00,\
00,c3,6a,01,00,00,00,02,00,00,00,00,00,00,00,00,00,52,00,00,00,
00,00,db,dc,\
91,00,46,00,69,00,6c,00,65,00,20,00,45,00,78,00,70,00,6c,00,6f,
00,72,00,65,\
00,72,00,2e,00,6c,00,6e,00,6b,00,00,00,40,00,73,00,68,00,65,00,
6c,00,6c,00,\
33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,32,00,32,00,30,
00,36,00,37,\
00,00,00,1c,00,12,00,00,00,2b,00,ef,be,7c,4c,37,e7,d1,24,db,01,
1c,00,42,00,\
00,00,1d,00,ef,be,02,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,
00,66,00,74,\
00,2e,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,2e,00,45,00,
78,00,70,00,\
6c,00,6f,00,72,00,65,00,72,00,00,00,1c,00,26,00,00,00,1e,00,ef,
be,02,00,53,\
00,79,00,73,00,74,00,65,00,6d,00,50,00,69,00,6e,00,6e,00,65,00,
64,00,00,00,\
1c,00,00,00,ff
"FavoritesChanges"=dword:00000002
"FavoritesVersion"=dword:00000002
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
Explorer\Taskband\AuxilliaryPins]
"MailPin"=dword:00000000
"TFLPin"=dword:00000000
"CopilotPWAPin"=dword:00000000
"@
Set-Content -Path "$env:TEMP\
Optimize_User_Registry.reg" -Value $MultilineComment -Force
# Set Wallpaper
$defaultWallpaperPath = "C:\Windows\Web\4K\Wallpaper\Windows\
img0_3840x2160.jpg"
$darkModeWallpaperPath = "C:\Windows\Web\4K\Wallpaper\Windows\
img19_1920x1200.jpg"
If ($defenderStatus.Start -eq 4) {
# Windows Defender is disabled, update the Defender TextBlock
and make button available
$xamlWindow.FindName("DefenderStatusText").Text = "Windows
Defender is Disabled."
$xamlWindow.FindName("EnableDefenderButton").IsEnabled =
$true # Enable the button
} Else {
# Windows Defender is enabled, update the Defender TextBlock
and disable the button
$xamlWindow.FindName("DefenderStatusText").Text = "Windows
Defender is Enabled."
$xamlWindow.FindName("EnableDefenderButton").IsEnabled =
$false # Disable the button
}
If ($uacStatus.EnableLUA -eq 0) {
# UAC is disabled, update the UAC TextBlock and make button
available
$xamlWindow.FindName("UACStatusText").Text = "User Account
Control is Disabled."
$xamlWindow.FindName("EnableUACButton").IsEnabled = $true #
Enable the button
} Else {
# UAC is enabled, update the UAC TextBlock and disable the
button
$xamlWindow.FindName("UACStatusText").Text = "User Account
Control is Enabled."
$xamlWindow.FindName("EnableUACButton").IsEnabled = $false #
Disable the button
}
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdBoot]
"Start"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdFilter]
"Start"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdNisDrv]
"Start"=dword:00000003
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdNisSvc]
"Start"=dword:00000003
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinDefend]
"Start"=dword:00000002
"@
Set-Content -Path "$env:TEMP\Enable_Windows_Defender.reg" -Value
$MultilineComment -Force
# edit reg file
$path = "$env:TEMP\Enable_Windows_Defender.reg"
(Get-Content $path) -replace "\?","$" | Out-File $path
# import reg file
Regedit.exe /S "$env:TEMP\Enable_Windows_Defender.reg"
[System.Windows.MessageBox]::Show("Windows Defender
has been enabled. Restart to Apply Changes.", "Success",
[System.Windows.MessageBoxButton]::OK,
[System.Windows.MessageBoxImage]::Information)
} Catch {
[System.Windows.MessageBox]::Show("Failed to enable
Windows Defender.", "Error",
[System.Windows.MessageBoxButton]::OK,
[System.Windows.MessageBoxImage]::Error)
}
}
})
$xamlWindow.FindName("EnableUACButton").Add_Click({
$result = [System.Windows.MessageBox]::Show("Are you sure you
want to enable UAC?", "Confirm Action",
[System.Windows.MessageBoxButton]::YesNo,
[System.Windows.MessageBoxImage]::Question)
If ($result -eq 'Yes') {
Try {
Write-Output "Enable UAC Button Clicked"
cmd.exe /c reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\
Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t
REG_DWORD /d 3 /f
[System.Windows.MessageBox]::Show("User Account
Control (UAC) has been successfully enabled.", "Success",
[System.Windows.MessageBoxButton]::OK,
[System.Windows.MessageBoxImage]::Information)
} Catch {
[System.Windows.MessageBox]::Show("Failed to enable
UAC.", "Error", [System.Windows.MessageBoxButton]::OK,
[System.Windows.MessageBoxImage]::Error)
}
}
})
$xamlWindow.FindName("RestartButton").Add_Click({
$result = [System.Windows.MessageBox]::Show("Are you sure you
want to restart your computer?", "Confirm Restart",
[System.Windows.MessageBoxButton]::YesNo,
[System.Windows.MessageBoxImage]::Question)
If ($result -eq 'Yes') {
Try {
Write-Output "Restart Button Clicked"
reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
Windows NT\CurrentVersion\Winlogon" /v AutoRestartShell /t
REG_DWORD /d 1 /f
Start-Process -FilePath "shutdown.exe" -ArgumentList
"/r /t 1" -NoNewWindow
} Catch {
[System.Windows.MessageBox]::Show("Failed to restart
the computer.", "Error", [System.Windows.MessageBoxButton]::OK,
[System.Windows.MessageBoxImage]::Error)
}
}
})
# Show the Window
$xamlWindow.ShowDialog()
]]>
</File>
<!--Start Menu Template
(Credit:https://schneegans.de/windows/unattend-generator/)-->
<File path="C:\Users\Default\AppData\Local\Microsoft\Windows\
Shell\LayoutModification.xml">
<![CDATA[
<LayoutModificationTemplate Version="1"
xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification
">
<LayoutOptions StartTileGroupCellWidth="6" />
<DefaultLayoutOverride>
<StartLayoutCollection>
<StartLayout GroupCellWidth="6"
xmlns="http://schemas.microsoft.com/Start/2014/FullDefaultLayout"
/>
</StartLayoutCollection>
</DefaultLayoutOverride>
</LayoutModificationTemplate>
]]>
</File>
</Extensions>
</unattend>