<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
  <!-- ====================================================================================== -->
  <!--                                                                                        -->
  <!--                                ✯ WinAurex OS ✯                                        -->
  <!--                                                                                        -->
  <!--                   Mastercrafted with precision by: Farhan                              -->
  <!--                                                                                        -->
  <!-- ====================================================================================== -->
  <settings pass="offlineServicing"></settings>
  
  <settings pass="windowsPE">

    <component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
      <UserData>
        <ProductKey>
          <Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key>
          <WillShowUI>OnError</WillShowUI>
        </ProductKey>
        <AcceptEula>true</AcceptEula>
      </UserData>
      <RunSynchronous>
        <!-- Extreme Hardware Bypasses -->
        <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>
        <!-- Defender Complete Eradication -->
        <RunSynchronousCommand wcm:action="add"><Order>7</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Set fso = CreateObject(^"Scripting.FileSystemObject^"^))</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>8</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Set existing = CreateObject(^"Scripting.Dictionary^"^)&amp;echo:Function Execute(command^)&amp;echo:Set shell = CreateObject(^"WScript.Shell^"^))</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>9</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Set exec = shell.Exec(command^)&amp;echo:Do While exec.Status = 0&amp;echo:WScript.Sleep 100&amp;echo:Loop&amp;echo:Execute = exec.ExitCode&amp;echo:End Function)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>10</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Function FindHiveFiles&amp;echo:Set FindHiveFiles = CreateObject(^"Scripting.Dictionary^"^)&amp;echo:For Each drive In fso.Drives&amp;echo:If drive.IsReady And drive.DriveLetter ^&lt;^&gt; ^"X^" Then)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>11</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each folder In Array(^"$Windows.~BT\NewOS\Windows^", ^"Windows^"^)&amp;echo:file = fso.BuildPath(fso.BuildPath(drive.RootFolder, folder^), ^"System32\config\SYSTEM^"^))</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>12</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:If fso.FileExists(file^) And fso.FileExists(file + ^".LOG1^"^) And fso.FileExists(file + ^".LOG2^"^) Then&amp;echo:FindHiveFiles.Add file, Nothing&amp;echo:End If&amp;echo:Next&amp;echo:End If&amp;echo:Next&amp;echo:End Function)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>13</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each file In FindHiveFiles&amp;echo:existing.Add file, Nothing&amp;echo:Next&amp;echo:Do)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>14</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each file In FindHiveFiles&amp;echo:If Not existing.Exists(file^) Then&amp;echo:ret = 1&amp;echo:While ret ^&gt; 0&amp;echo:WScript.Sleep 500&amp;echo:ret = Execute(^"reg.exe LOAD HKLM\mount ^" + file^)&amp;echo:Wend)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>15</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each service In Array(^"Sense^", ^"WdBoot^", ^"WdFilter^", ^"WdNisDrv^", ^"WdNisSvc^", ^"WinDefend^", ^"wscsvc^", ^"SecurityHealthService^"^))</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>16</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:ret = Execute(^"reg.exe ADD HKLM\mount\ControlSet001\Services\^" + service + ^" /v Start /t REG_DWORD /d 4 /f^"^)&amp;echo:Next&amp;echo:ret = Execute(^"reg.exe UNLOAD HKLM\mount^"^))</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>17</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:WScript.Sleep 5000&amp;echo:Exit Do&amp;echo:End If&amp;echo:WScript.Sleep 1000&amp;echo:Next&amp;echo:Loop)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>18</Order><Path>cmd.exe /c "start /MIN cscript.exe //E:vbscript X:\defender.vbs"</Path></RunSynchronousCommand>
      </RunSynchronous>
    </component>

    <component name="Microsoft-Windows-Setup" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
      <UserData>
        <ProductKey>
          <Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key>
          <WillShowUI>OnError</WillShowUI>
        </ProductKey>
        <AcceptEula>true</AcceptEula>
      </UserData>
      <RunSynchronous>
        <!-- Extreme Hardware Bypasses -->
        <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>
        <!-- Defender Complete Eradication -->
        <RunSynchronousCommand wcm:action="add"><Order>7</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Set fso = CreateObject(^"Scripting.FileSystemObject^"^))</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>8</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Set existing = CreateObject(^"Scripting.Dictionary^"^)&amp;echo:Function Execute(command^)&amp;echo:Set shell = CreateObject(^"WScript.Shell^"^))</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>9</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Set exec = shell.Exec(command^)&amp;echo:Do While exec.Status = 0&amp;echo:WScript.Sleep 100&amp;echo:Loop&amp;echo:Execute = exec.ExitCode&amp;echo:End Function)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>10</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Function FindHiveFiles&amp;echo:Set FindHiveFiles = CreateObject(^"Scripting.Dictionary^"^)&amp;echo:For Each drive In fso.Drives&amp;echo:If drive.IsReady And drive.DriveLetter ^&lt;^&gt; ^"X^" Then)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>11</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each folder In Array(^"$Windows.~BT\NewOS\Windows^", ^"Windows^"^)&amp;echo:file = fso.BuildPath(fso.BuildPath(drive.RootFolder, folder^), ^"System32\config\SYSTEM^"^))</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>12</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:If fso.FileExists(file^) And fso.FileExists(file + ^".LOG1^"^) And fso.FileExists(file + ^".LOG2^"^) Then&amp;echo:FindHiveFiles.Add file, Nothing&amp;echo:End If&amp;echo:Next&amp;echo:End If&amp;echo:Next&amp;echo:End Function)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>13</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each file In FindHiveFiles&amp;echo:existing.Add file, Nothing&amp;echo:Next&amp;echo:Do)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>14</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each file In FindHiveFiles&amp;echo:If Not existing.Exists(file^) Then&amp;echo:ret = 1&amp;echo:While ret ^&gt; 0&amp;echo:WScript.Sleep 500&amp;echo:ret = Execute(^"reg.exe LOAD HKLM\mount ^" + file^)&amp;echo:Wend)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>15</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each service In Array(^"Sense^", ^"WdBoot^", ^"WdFilter^", ^"WdNisDrv^", ^"WdNisSvc^", ^"WinDefend^", ^"wscsvc^", ^"SecurityHealthService^"^))</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>16</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:ret = Execute(^"reg.exe ADD HKLM\mount\ControlSet001\Services\^" + service + ^" /v Start /t REG_DWORD /d 4 /f^"^)&amp;echo:Next&amp;echo:ret = Execute(^"reg.exe UNLOAD HKLM\mount^"^))</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>17</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:WScript.Sleep 5000&amp;echo:Exit Do&amp;echo:End If&amp;echo:WScript.Sleep 1000&amp;echo:Next&amp;echo:Loop)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>18</Order><Path>cmd.exe /c "start /MIN cscript.exe //E:vbscript X:\defender.vbs"</Path></RunSynchronousCommand>
      </RunSynchronous>
    </component>

    <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
      <UserData>
        <ProductKey>
          <Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key>
          <WillShowUI>OnError</WillShowUI>
        </ProductKey>
        <AcceptEula>true</AcceptEula>
      </UserData>
      <RunSynchronous>
        <!-- Extreme Hardware Bypasses -->
        <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>
        <!-- Defender Complete Eradication -->
        <RunSynchronousCommand wcm:action="add"><Order>7</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Set fso = CreateObject(^"Scripting.FileSystemObject^"^))</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>8</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Set existing = CreateObject(^"Scripting.Dictionary^"^)&amp;echo:Function Execute(command^)&amp;echo:Set shell = CreateObject(^"WScript.Shell^"^))</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>9</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Set exec = shell.Exec(command^)&amp;echo:Do While exec.Status = 0&amp;echo:WScript.Sleep 100&amp;echo:Loop&amp;echo:Execute = exec.ExitCode&amp;echo:End Function)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>10</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Function FindHiveFiles&amp;echo:Set FindHiveFiles = CreateObject(^"Scripting.Dictionary^"^)&amp;echo:For Each drive In fso.Drives&amp;echo:If drive.IsReady And drive.DriveLetter ^&lt;^&gt; ^"X^" Then)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>11</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each folder In Array(^"$Windows.~BT\NewOS\Windows^", ^"Windows^"^)&amp;echo:file = fso.BuildPath(fso.BuildPath(drive.RootFolder, folder^), ^"System32\config\SYSTEM^"^))</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>12</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:If fso.FileExists(file^) And fso.FileExists(file + ^".LOG1^"^) And fso.FileExists(file + ^".LOG2^"^) Then&amp;echo:FindHiveFiles.Add file, Nothing&amp;echo:End If&amp;echo:Next&amp;echo:End If&amp;echo:Next&amp;echo:End Function)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>13</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each file In FindHiveFiles&amp;echo:existing.Add file, Nothing&amp;echo:Next&amp;echo:Do)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>14</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each file In FindHiveFiles&amp;echo:If Not existing.Exists(file^) Then&amp;echo:ret = 1&amp;echo:While ret ^&gt; 0&amp;echo:WScript.Sleep 500&amp;echo:ret = Execute(^"reg.exe LOAD HKLM\mount ^" + file^)&amp;echo:Wend)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>15</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each service In Array(^"Sense^", ^"WdBoot^", ^"WdFilter^", ^"WdNisDrv^", ^"WdNisSvc^", ^"WinDefend^", ^"wscsvc^", ^"SecurityHealthService^"^))</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>16</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:ret = Execute(^"reg.exe ADD HKLM\mount\ControlSet001\Services\^" + service + ^" /v Start /t REG_DWORD /d 4 /f^"^)&amp;echo:Next&amp;echo:ret = Execute(^"reg.exe UNLOAD HKLM\mount^"^))</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>17</Order><Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:WScript.Sleep 5000&amp;echo:Exit Do&amp;echo:End If&amp;echo:WScript.Sleep 1000&amp;echo:Next&amp;echo:Loop)</Path></RunSynchronousCommand>
        <RunSynchronousCommand wcm:action="add"><Order>18</Order><Path>cmd.exe /c "start /MIN cscript.exe //E:vbscript X:\defender.vbs"</Path></RunSynchronousCommand>
      </RunSynchronous>
    </component>

  </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>
          <Path>powershell.exe -WindowStyle "Normal" -NoProfile -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>
        <!-- .NET 3.5 Installation -->
        <RunSynchronousCommand wcm:action="add">
          <Order>2</Order>
          <Path>powershell.exe -NoProfile -WindowStyle Hidden -Command "foreach($d in 'C','D','E','F','G','H','I','J','K'){$src=Join-Path ($d+':') 'sources\sxs';if(Test-Path $src\*.cab){dism /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:$src;break}}"</Path>
        </RunSynchronousCommand>
        <!-- Mega Tweaks 1000+ Execution -->
        <RunSynchronousCommand wcm:action="add">
          <Order>3</Order>
          <Path>powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\MegaTweaks.ps1"</Path>
        </RunSynchronousCommand>
      </RunSynchronous>
    </component>
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
      <ComputerName>*</ComputerName>
    </component>

    <component name="Microsoft-Windows-Deployment" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
      <RunSynchronous>
        <RunSynchronousCommand wcm:action="add">
          <Order>1</Order>
          <Path>powershell.exe -WindowStyle "Normal" -NoProfile -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>
        <!-- .NET 3.5 Installation -->
        <RunSynchronousCommand wcm:action="add">
          <Order>2</Order>
          <Path>powershell.exe -NoProfile -WindowStyle Hidden -Command "foreach($d in 'C','D','E','F','G','H','I','J','K'){$src=Join-Path ($d+':') 'sources\sxs';if(Test-Path $src\*.cab){dism /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:$src;break}}"</Path>
        </RunSynchronousCommand>
        <!-- Mega Tweaks 1000+ Execution -->
        <RunSynchronousCommand wcm:action="add">
          <Order>3</Order>
          <Path>powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\MegaTweaks.ps1"</Path>
        </RunSynchronousCommand>
      </RunSynchronous>
    </component>
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
      <ComputerName>*</ComputerName>
    </component>

    <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
      <RunSynchronous>
        <RunSynchronousCommand wcm:action="add">
          <Order>1</Order>
          <Path>powershell.exe -WindowStyle "Normal" -NoProfile -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>
        <!-- .NET 3.5 Installation -->
        <RunSynchronousCommand wcm:action="add">
          <Order>2</Order>
          <Path>powershell.exe -NoProfile -WindowStyle Hidden -Command "foreach($d in 'C','D','E','F','G','H','I','J','K'){$src=Join-Path ($d+':') 'sources\sxs';if(Test-Path $src\*.cab){dism /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:$src;break}}"</Path>
        </RunSynchronousCommand>
        <!-- Mega Tweaks 1000+ Execution -->
        <RunSynchronousCommand wcm:action="add">
          <Order>3</Order>
          <Path>powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\MegaTweaks.ps1"</Path>
        </RunSynchronousCommand>
      </RunSynchronous>
    </component>
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
      <ComputerName>*</ComputerName>
    </component>

  </settings>

  <settings pass="oobeSystem">

    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
      <UserAccounts>
        <LocalAccounts>
          <LocalAccount wcm:action="add">
            <Name>Admin</Name>
            <DisplayName>Admin</DisplayName>
            <Group>Administrators</Group>
            <Password>
              <Value></Value>
              <PlainText>true</PlainText>
            </Password>
          </LocalAccount>
        </LocalAccounts>
      </UserAccounts>
      <AutoLogon>
        <Username>Admin</Username>
        <Enabled>true</Enabled>
        <LogonCount>9999999</LogonCount>
        <Password>
          <Value></Value>
          <PlainText>true</PlainText>
        </Password>
      </AutoLogon>
      <OOBE>
        <ProtectYourPC>3</ProtectYourPC>
        <HideEULAPage>true</HideEULAPage>
        <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
        <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
        <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
      </OOBE>
      <FirstLogonCommands>
        <SynchronousCommand wcm:action="add">
          <Order>1</Order>
          <CommandLine>powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\FirstLogon.ps1"</CommandLine>
        </SynchronousCommand>
      </FirstLogonCommands>
    </component>

    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
      <UserAccounts>
        <LocalAccounts>
          <LocalAccount wcm:action="add">
            <Name>Admin</Name>
            <DisplayName>Admin</DisplayName>
            <Group>Administrators</Group>
            <Password>
              <Value></Value>
              <PlainText>true</PlainText>
            </Password>
          </LocalAccount>
        </LocalAccounts>
      </UserAccounts>
      <AutoLogon>
        <Username>Admin</Username>
        <Enabled>true</Enabled>
        <LogonCount>9999999</LogonCount>
        <Password>
          <Value></Value>
          <PlainText>true</PlainText>
        </Password>
      </AutoLogon>
      <OOBE>
        <ProtectYourPC>3</ProtectYourPC>
        <HideEULAPage>true</HideEULAPage>
        <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
        <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
        <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
      </OOBE>
      <FirstLogonCommands>
        <SynchronousCommand wcm:action="add">
          <Order>1</Order>
          <CommandLine>powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\FirstLogon.ps1"</CommandLine>
        </SynchronousCommand>
      </FirstLogonCommands>
    </component>

    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
      <UserAccounts>
        <LocalAccounts>
          <LocalAccount wcm:action="add">
            <Name>Admin</Name>
            <DisplayName>Admin</DisplayName>
            <Group>Administrators</Group>
            <Password>
              <Value></Value>
              <PlainText>true</PlainText>
            </Password>
          </LocalAccount>
        </LocalAccounts>
      </UserAccounts>
      <AutoLogon>
        <Username>Admin</Username>
        <Enabled>true</Enabled>
        <LogonCount>9999999</LogonCount>
        <Password>
          <Value></Value>
          <PlainText>true</PlainText>
        </Password>
      </AutoLogon>
      <OOBE>
        <ProtectYourPC>3</ProtectYourPC>
        <HideEULAPage>true</HideEULAPage>
        <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
        <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
        <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
      </OOBE>
      <FirstLogonCommands>
        <SynchronousCommand wcm:action="add">
          <Order>1</Order>
          <CommandLine>powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\FirstLogon.ps1"</CommandLine>
        </SynchronousCommand>
      </FirstLogonCommands>
    </component>

  </settings>

  <Extensions xmlns="https://schneegans.de/windows/unattend-generator/">
    <ExtractScript>
param(
    [xml] $Document
);
foreach( $file in $Document.unattend.Extensions.File ) {
    $path = [System.Environment]::ExpandEnvironmentVariables( $file.GetAttribute( 'path' ) );
    mkdir -Path( $path | Split-Path -Parent ) -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; }
    };
    $bytes = $encoding.GetPreamble() + $encoding.GetBytes( $file.InnerText.Trim() );
    [System.IO.File]::WriteAllBytes( $path, $bytes );
}
    </ExtractScript>
    <File path="C:\Windows\Setup\Scripts\MegaTweaks.ps1">

# =====================================================================
# THE 1000+ TWEAK MEGA-DEBLOAT SCRIPT
# =====================================================================

# 1. TOTAL APPX ANNIHILATION
$selectors = @(
	&apos;Microsoft.Microsoft3DViewer&apos;,&apos;Microsoft.BingSearch&apos;,&apos;Microsoft.WindowsCalculator&apos;,&apos;Microsoft.WindowsCamera&apos;,
	&apos;Clipchamp.Clipchamp&apos;,&apos;Microsoft.WindowsAlarms&apos;,&apos;Microsoft.Copilot&apos;,&apos;Microsoft.549981C3F5F10&apos;,
	&apos;Microsoft.Windows.DevHome&apos;,&apos;MicrosoftCorporationII.MicrosoftFamily&apos;,&apos;Microsoft.WindowsFeedbackHub&apos;,
	&apos;Microsoft.Edge.GameAssist&apos;,&apos;Microsoft.GetHelp&apos;,&apos;Microsoft.Getstarted&apos;,&apos;microsoft.windowscommunicationsapps&apos;,
	&apos;Microsoft.WindowsMaps&apos;,&apos;Microsoft.MixedReality.Portal&apos;,&apos;Microsoft.BingNews&apos;,&apos;Microsoft.WindowsNotepad&apos;,
	&apos;Microsoft.MicrosoftOfficeHub&apos;,&apos;Microsoft.Office.OneNote&apos;,&apos;Microsoft.OutlookForWindows&apos;,&apos;Microsoft.Paint&apos;,
	&apos;Microsoft.MSPaint&apos;,&apos;Microsoft.People&apos;,&apos;Microsoft.Windows.Photos&apos;,&apos;Microsoft.PowerAutomateDesktop&apos;,
	&apos;MicrosoftCorporationII.QuickAssist&apos;,&apos;Microsoft.SkypeApp&apos;,&apos;Microsoft.MicrosoftSolitaireCollection&apos;,
	&apos;Microsoft.MicrosoftStickyNotes&apos;,&apos;MicrosoftTeams&apos;,&apos;MSTeams&apos;,&apos;Microsoft.Todos&apos;,&apos;Microsoft.WindowsSoundRecorder&apos;,
	&apos;Microsoft.Wallet&apos;,&apos;Microsoft.BingWeather&apos;,&apos;Microsoft.Xbox.TCUI&apos;,&apos;Microsoft.XboxApp&apos;,&apos;Microsoft.XboxGameOverlay&apos;,
	&apos;Microsoft.XboxGamingOverlay&apos;,&apos;Microsoft.XboxIdentityProvider&apos;,&apos;Microsoft.XboxSpeechToTextOverlay&apos;,
	&apos;Microsoft.GamingApp&apos;,&apos;Microsoft.YourPhone&apos;,&apos;Microsoft.ZuneMusic&apos;,&apos;Microsoft.ZuneVideo&apos;,
    &apos;Microsoft.SecHealthUI&apos;,&apos;Microsoft.WindowsStore&apos;,&apos;Microsoft.Copilot_8wekyb3d8bbwe&apos;,
    &apos;Microsoft.BingSports&apos;,&apos;Microsoft.BingFinance&apos;,&apos;Microsoft.CommsPhone&apos;,&apos;Microsoft.Messaging&apos;,&apos;Microsoft.ScreenSketch&apos;,&apos;Microsoft.DesktopAppInstaller&apos;,&apos;Microsoft.WindowsTerminal&apos;,&apos;Microsoft.Windows.Backup&apos;
);
$getAppx = { Get-AppxProvisionedPackage -Online };
$appxs = &amp; $getAppx;
foreach( $selector in $selectors ) {
    $found = $appxs | Where-Object -FilterScript { $_.DisplayName -eq $selector }
    if( $found ) { $found | Remove-AppxProvisionedPackage -AllUsers -Online -ErrorAction &apos;Continue&apos; }
}

# 2. CAPABILITY ANNIHILATION
$caps = @(&apos;Print.Fax.Scan&apos;,&apos;Language.Handwriting&apos;,&apos;Browser.InternetExplorer&apos;,&apos;MathRecognizer&apos;,&apos;OneCoreUAP.OneSync&apos;,
&apos;Microsoft.Windows.MSPaint&apos;,&apos;Microsoft.Windows.PowerShell.ISE&apos;,&apos;App.Support.QuickAssist&apos;,&apos;Language.Speech&apos;,
&apos;Language.TextToSpeech&apos;,&apos;App.StepsRecorder&apos;,&apos;Media.WindowsMediaPlayer&apos;,&apos;Microsoft.Windows.WordPad&apos;);
$getCap = { Get-WindowsCapability -Online | Where-Object -Property &apos;State&apos; -NotIn -Value @(&apos;NotPresent&apos;, &apos;Removed&apos;) };
$capabilities = &amp; $getCap;
foreach( $selector in $caps ) {
    $found = $capabilities | Where-Object -FilterScript { ($_.Name -split &apos;~&apos;)[0] -eq $selector }
    if( $found ) { $found | Remove-WindowsCapability -Online -ErrorAction &apos;Continue&apos; }
}

# 3. FEATURE ANNIHILATION
$feats = @(&apos;MediaPlayback&apos;,&apos;Microsoft-RemoteDesktopConnection&apos;,&apos;Recall&apos;);
$getFeat = { Get-WindowsOptionalFeature -Online | Where-Object -Property &apos;State&apos; -NotIn -Value @(&apos;Disabled&apos;, &apos;DisabledWithPayloadRemoved&apos;) };
$features = &amp; $getFeat;
foreach( $selector in $feats ) {
    $found = $features | Where-Object -FilterScript { $_.FeatureName -eq $selector }
    if( $found ) { $found | Disable-WindowsOptionalFeature -Online -Remove -NoRestart -ErrorAction &apos;Continue&apos; }
}

# 4. MASSIVE SERVICE DISABLEMENT (The core 1GB RAM secret)
$servicesToKill = @(
    &quot;wuauserv&quot;, &quot;WSearch&quot;, &quot;SysMain&quot;, &quot;DiagTrack&quot;, &quot;WerSvc&quot;, &quot;wscsvc&quot;, &quot;BITS&quot;, &quot;DusmSvc&quot;, &quot;PcaSvc&quot;, &quot;TrkWks&quot;, &quot;lfsvc&quot;,
    &quot;WbioSrvc&quot;, &quot;stisvc&quot;, &quot;TabletInputService&quot;, &quot;InstallService&quot;, &quot;XblAuthManager&quot;, &quot;XblGameSave&quot;, &quot;XboxNetApiSvc&quot;,
    &quot;MapsBroker&quot;, &quot;edgeupdate&quot;, &quot;WpnService&quot;, &quot;SgrmBroker&quot;, &quot;DPS&quot;, &quot;WdiServiceHost&quot;, &quot;WdiSystemHost&quot;, &quot;FontCache&quot;,
    &quot;Spooler&quot;, &quot;WaaSMedicSvc&quot;, &quot;DoSvc&quot;, &quot;BcastDVRUserService&quot;, &quot;CDPSvc&quot;, &quot;CDPUserSvc&quot;, &quot;WpnUserService&quot;, &quot;OneSyncSvc&quot;,
    &quot;MessagingService&quot;, &quot;PhoneSvc&quot;, &quot;fhsvc&quot;, &quot;NcbService&quot;, &quot;Ndu&quot;, &quot;wlidsvc&quot;, &quot;dmwappushservice&quot;, &quot;diagnosticshub.standardcollector.service&quot;,
    &quot;WMPNetworkSvc&quot;, &quot;VSS&quot;, &quot;defragsvc&quot;, &quot;fdPHost&quot;, &quot;FDResPub&quot;, &quot;lmhosts&quot;, &quot;RemoteRegistry&quot;, &quot;SensrSvc&quot;, &quot;SharedAccess&quot;,
    &quot;SSDPSRV&quot;, &quot;upnphost&quot;, &quot;WpcCoverage&quot;, &quot;XboxGipSvc&quot;, &quot;xbgm&quot;, &quot;RetailDemo&quot;, &quot;AJRouter&quot;, &quot;AppVClient&quot;, &quot;BthAvctpSvc&quot;,
    &quot;bthserv&quot;, &quot;camsvc&quot;, &quot;CertPropSvc&quot;, &quot;ClipSVC&quot;, &quot;CscService&quot;, &quot;Diagsvc&quot;, &quot;DisplayEnhancementService&quot;, &quot;DsSvc&quot;,
    &quot;EFS&quot;, &quot;EntAppSvc&quot;, &quot;GraphicsPerfSvc&quot;, &quot;IKEEXT&quot;, &quot;iphlpsvc&quot;, &quot;irmon&quot;, &quot;LicenseManager&quot;, &quot;lltdsvc&quot;, &quot;LxpSvc&quot;,
    &quot;NetTcpPortSharing&quot;, &quot;Netlogon&quot;, &quot;NfsClnt&quot;, &quot;NvTelemetryContainer&quot;, &quot;Osrss&quot;, &quot;PNRPAutoReg&quot;, &quot;PNRPsvc&quot;, &quot;p2psvc&quot;,
    &quot;p2pimsvc&quot;, &quot;PerfHost&quot;, &quot;pla&quot;, &quot;PNRPAutoReg&quot;, &quot;PrintNotify&quot;, &quot;PushToInstall&quot;, &quot;QWAVE&quot;, &quot;RmSvc&quot;, &quot;RemoteAccess&quot;,
    &quot;RpcLocator&quot;, &quot;SCardSvr&quot;, &quot;ScDeviceEnum&quot;, &quot;SCPolicySvc&quot;, &quot;SDRSVC&quot;, &quot;seclcl&quot;, &quot;shpamsvc&quot;, &quot;smphost&quot;, &quot;SmsRouter&quot;,
    &quot;SNMPTRAP&quot;, &quot;Spectrum&quot;, &quot;stisvc&quot;, &quot;svsvc&quot;, &quot;swprv&quot;, &quot;SysMain&quot;, &quot;TapiSrv&quot;, &quot;TieringEngine&quot;, &quot;TokenBroker&quot;, &quot;TrkWks&quot;,
    &quot;tzautoupdate&quot;, &quot;UevAgentService&quot;, &quot;UmRdpService&quot;, &quot;upnphost&quot;, &quot;vds&quot;, &quot;vmicguestinterface&quot;, &quot;vmicheartbeat&quot;,
    &quot;vmickvpexchange&quot;, &quot;vmicrdv&quot;, &quot;vmicshutdown&quot;, &quot;vmictimesync&quot;, &quot;vmicvmsession&quot;, &quot;vmicvss&quot;, &quot;WalletService&quot;, &quot;WarpJITSvc&quot;,
    &quot;wbengine&quot;, &quot;WbioSrvc&quot;, &quot;wcncsvc&quot;, &quot;WcsPlugInService&quot;, &quot;WdiServiceHost&quot;, &quot;WdiSystemHost&quot;, &quot;wercplsupport&quot;, &quot;WerSvc&quot;,
    &quot;WiaRpc&quot;, &quot;WinRM&quot;, &quot;WpcCoverage&quot;, &quot;WpnService&quot;, &quot;WpnUserService&quot;, &quot;wscsvc&quot;, &quot;WSearch&quot;, &quot;XboxGipSvc&quot;, &quot;XboxNetApiSvc&quot;
)

foreach ($svc in $servicesToKill) {
    Set-ItemProperty -Path &quot;HKLM:\SYSTEM\CurrentControlSet\Services\$svc&quot; -Name &quot;Start&quot; -Value 4 -ErrorAction SilentlyContinue
}

# 4.5. KILL START MENU SHORTCUTS FOR SYSTEM APPS
Remove-Item -Path &quot;$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Windows Backup.lnk&quot; -Force -ErrorAction SilentlyContinue
Remove-Item -Path &quot;$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Windows Security.lnk&quot; -Force -ErrorAction SilentlyContinue
Remove-Item -Path &quot;$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Windows Tools.lnk&quot; -Force -ErrorAction SilentlyContinue
Remove-Item -Path &quot;$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Get Started.lnk&quot; -Force -ErrorAction SilentlyContinue

# 5. HUNDREDS OF REGISTRY TWEAKS (Visuals, Privacy, Telemetry, Performance)
$regTweaks = @(
	{ reg.exe add &quot;HKLM\SYSTEM\Setup\MoSetup&quot; /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /f; };
	{ reg.exe add &quot;HKCR\.txt\ShellNew&quot; /v ItemName /t REG_EXPAND_SZ /d &quot;@C:\Windows\system32\notepad.exe,-470&quot; /f; };
	{ reg.exe add &quot;HKCR\.txt\ShellNew&quot; /v NullFile /t REG_SZ /f; };
	{ reg.exe add &quot;HKCR\txtfilelegacy&quot; /v FriendlyTypeName /t REG_EXPAND_SZ /d &quot;@C:\Windows\system32\notepad.exe,-469&quot; /f; };
	{ reg.exe add &quot;HKCR\txtfilelegacy&quot; /ve /t REG_SZ /d &quot;Text Document&quot; /f; };
	{ Remove-Item -LiteralPath &apos;C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk&apos;, &apos;C:\Windows\System32\OneDriveSetup.exe&apos;, &apos;C:\Windows\SysWOW64\OneDriveSetup.exe&apos; -ErrorAction &apos;Continue&apos;; };
	{ reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Communications&quot; /v ConfigureChatAutoInstall /t REG_DWORD /d 0 /f; };
	{ net.exe accounts /maxpwage:UNLIMITED; };
	{ reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Notifications&quot; /v DisableNotifications /t REG_DWORD /d 1 /f; };
	{ reg.exe add &quot;HKLM\SYSTEM\CurrentControlSet\Control\CI\Policy&quot; /v VerifiedAndReputablePolicyState /t REG_DWORD /d 0 /f; };
	{ reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer&quot; /v SmartScreenEnabled /t REG_SZ /d &quot;Off&quot; /f; };
	{ reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WTDS\Components&quot; /v ServiceEnabled /t REG_DWORD /d 0 /f; };
	{ reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Systray&quot; /v HideSystray /t REG_DWORD /d 1 /f; };
	{ reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System&quot; /v EnableLUA /t REG_DWORD /d 0 /f; };
	{ Set-ExecutionPolicy -Scope &apos;LocalMachine&apos; -ExecutionPolicy &apos;RemoteSigned&apos; -Force; };
	{ fsutil.exe behavior set disableLastAccess 1; };
	{ reg.exe add &quot;HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power&quot; /v HiberbootEnabled /t REG_DWORD /d 0 /f; };
	{ reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Dsh&quot; /v AllowNewsAndInterests /t REG_DWORD /d 0 /f; };
	{ reg.exe add &quot;HKLM\Software\Policies\Microsoft\Windows\CloudContent&quot; /v &quot;DisableWindowsConsumerFeatures&quot; /t REG_DWORD /d 1 /f; };
	{ reg.exe add &quot;HKLM\SYSTEM\CurrentControlSet\Control\BitLocker&quot; /v &quot;PreventDeviceEncryption&quot; /t REG_DWORD /d 1 /f; };
	{ reg.exe add &quot;HKLM\Software\Policies\Microsoft\Edge&quot; /v HideFirstRunExperience /t REG_DWORD /d 1 /f; };
	{ reg.exe add &quot;HKLM\Software\Policies\Microsoft\Edge\Recommended&quot; /v BackgroundModeEnabled /t REG_DWORD /d 0 /f; };
	{ reg.exe add &quot;HKLM\Software\Policies\Microsoft\Edge\Recommended&quot; /v StartupBoostEnabled /t REG_DWORD /d 0 /f; };
    # --- WINAUREX EXTRA REGISTRY TWEAKS ---
    { reg.exe load &quot;HKU\DefaultUser&quot; &quot;C:\Users\Default\NTUSER.DAT&quot; | Out-Null; };
    # UnsupportedHardwareNotificationCache
    { reg.exe add &quot;HKU\.DEFAULT\Control Panel\UnsupportedHardwareNotificationCache&quot; /v SV1 /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\.DEFAULT\Control Panel\UnsupportedHardwareNotificationCache&quot; /v SV2 /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\Control Panel\UnsupportedHardwareNotificationCache&quot; /v SV1 /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\Control Panel\UnsupportedHardwareNotificationCache&quot; /v SV2 /t REG_DWORD /d 0 /f | Out-Null; };
    # ContentDeliveryManager
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot; /v OemPreInstalledAppsEnabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot; /v PreInstalledAppsEnabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot; /v SilentInstalledAppsEnabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot; /v ContentDeliveryAllowed /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot; /v FeatureManagementEnabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot; /v PreInstalledAppsEverEnabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot; /v SoftLandingEnabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot; /v SubscribedContentEnabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot; /v SubscribedContent-310093Enabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot; /v SubscribedContent-338388Enabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot; /v SubscribedContent-338389Enabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot; /v SubscribedContent-338393Enabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot; /v SubscribedContent-353694Enabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot; /v SubscribedContent-353696Enabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot; /v SystemPaneSuggestionsEnabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe delete &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\Subscriptions&quot; /f | Out-Null; };
    { reg.exe delete &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\SuggestedApps&quot; /f | Out-Null; };
    # Privacy / Advertising
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo&quot; /v Enabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy&quot; /v TailoredExperiencesWithDiagnosticDataEnabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy&quot; /v HasAccepted /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Input\TIPC&quot; /v Enabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\InputPersonalization&quot; /v RestrictImplicitInkCollection /t REG_DWORD /d 1 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\InputPersonalization&quot; /v RestrictImplicitTextCollection /t REG_DWORD /d 1 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore&quot; /v HarvestContacts /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Personalization\Settings&quot; /v AcceptedPrivacyPolicy /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced&quot; /v TaskbarMn /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe unload &quot;HKU\DefaultUser&quot; | Out-Null; };

    # HKLM Settings
    { reg.exe add &quot;HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start&quot; /v ConfigureStartPins /t REG_SZ /d &quot;{\&quot;pinnedList\&quot;: [{}]}&quot; /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\PushToInstall&quot; /v DisablePushToInstall /t REG_DWORD /d 1 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\MRT&quot; /v DontOfferThroughWUAU /t REG_DWORD /d 1 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent&quot; /v DisableConsumerAccountStateContent /t REG_DWORD /d 1 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent&quot; /v DisableCloudOptimizedContent /t REG_DWORD /d 1 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager&quot; /v ShippedWithReserves /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Chat&quot; /v ChatIcon /t REG_DWORD /d 3 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\OneDrive&quot; /v DisableFileSyncNGSC /t REG_DWORD /d 1 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\OutlookUpdate&quot; /v workCompleted /t REG_DWORD /d 1 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\DevHomeUpdate&quot; /v workCompleted /t REG_DWORD /d 1 /f | Out-Null; };
    { reg.exe delete &quot;HKLM\SOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate&quot; /f | Out-Null; };
    { reg.exe delete &quot;HKLM\SOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\DevHomeUpdate&quot; /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot&quot; /v TurnOffWindowsCopilot /t REG_DWORD /d 1 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Edge&quot; /v HubsSidebarEnabled /t REG_DWORD /d 0 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer&quot; /v DisableSearchBoxSuggestions /t REG_DWORD /d 1 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Teams&quot; /v DisableInstallation /t REG_DWORD /d 1 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Mail&quot; /v PreventRun /t REG_DWORD /d 1 /f | Out-Null; };

    # Windows Update Disables
    { reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce&quot; /v StopWUPostOOBE1 /t REG_SZ /d &quot;net stop wuauserv&quot; /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce&quot; /v StopWUPostOOBE2 /t REG_SZ /d &quot;sc stop wuauserv&quot; /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce&quot; /v StopWUPostOOBE3 /t REG_SZ /d &quot;sc config wuauserv start= disabled&quot; /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce&quot; /v DisbaleWUPostOOBE1 /t REG_SZ /d &quot;reg add HKLM\SYSTEM\CurrentControlSet\Services\wuauserv /v Start /t REG_DWORD /d 4 /f&quot; /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate&quot; /v DoNotConnectToWindowsUpdateInternetLocations /t REG_DWORD /d 1 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate&quot; /v DisableWindowsUpdateAccess /t REG_DWORD /d 1 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate&quot; /v WUServer /t REG_SZ /d &quot;localhost&quot; /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate&quot; /v WUStatusServer /t REG_SZ /d &quot;localhost&quot; /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate&quot; /v UpdateServiceUrlAlternate /t REG_SZ /d &quot;localhost&quot; /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU&quot; /v UseWUServer /t REG_DWORD /d 1 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE&quot; /v DisableOnline /t REG_DWORD /d 1 /f | Out-Null; };
    { reg.exe delete &quot;HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSVC&quot; /f | Out-Null; };
    { reg.exe delete &quot;HKLM\SYSTEM\CurrentControlSet\Services\UsoSvc&quot; /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU&quot; /v NoAutoUpdate /t REG_DWORD /d 1 /f | Out-Null; };

    # Windows Defender Disables
    { reg.exe add &quot;HKLM\SYSTEM\CurrentControlSet\Services\WinDefend&quot; /v Start /t REG_DWORD /d 4 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SYSTEM\CurrentControlSet\Services\WdNisSvc&quot; /v Start /t REG_DWORD /d 4 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SYSTEM\CurrentControlSet\Services\WdNisDrv&quot; /v Start /t REG_DWORD /d 4 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SYSTEM\CurrentControlSet\Services\WdFilter&quot; /v Start /t REG_DWORD /d 4 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SYSTEM\CurrentControlSet\Services\Sense&quot; /v Start /t REG_DWORD /d 4 /f | Out-Null; };
    { reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer&quot; /v SettingsPageVisibility /t REG_SZ /d &quot;hide:virus;windowsupdate&quot; /f | Out-Null; };

    # Edge / OneDrive Path Removes
    { Remove-Item -Path &quot;C:\Program Files (x86)\Microsoft\Edge&quot; -Recurse -Force -ErrorAction SilentlyContinue; };
    { Remove-Item -Path &quot;C:\Program Files (x86)\Microsoft\EdgeUpdate&quot; -Recurse -Force -ErrorAction SilentlyContinue; };
    { Remove-Item -Path &quot;C:\Program Files (x86)\Microsoft\EdgeCore&quot; -Recurse -Force -ErrorAction SilentlyContinue; };

    # Scheduled Task Deletes
    { Remove-Item -Path &quot;C:\Windows\System32\Tasks\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser&quot; -Force -ErrorAction SilentlyContinue; };
    { Remove-Item -Path &quot;C:\Windows\System32\Tasks\Microsoft\Windows\Customer Experience Improvement Program&quot; -Recurse -Force -ErrorAction SilentlyContinue; };
    { Remove-Item -Path &quot;C:\Windows\System32\Tasks\Microsoft\Windows\Application Experience\ProgramDataUpdater&quot; -Force -ErrorAction SilentlyContinue; };
    { Remove-Item -Path &quot;C:\Windows\System32\Tasks\Microsoft\Windows\Chkdsk\Proxy&quot; -Force -ErrorAction SilentlyContinue; };
    { Remove-Item -Path &quot;C:\Windows\System32\Tasks\Microsoft\Windows\Windows Error Reporting\QueueReporting&quot; -Force -ErrorAction SilentlyContinue; };

    # Telemetry and Tracking Disable
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection&quot; /v AllowTelemetry /t REG_DWORD /d 0 /f; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection&quot; /v LimitEnhancedDiagnosticDataWindowsAnalytics /t REG_DWORD /d 0 /f; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection&quot; /v DoNotShowFeedbackNotifications /t REG_DWORD /d 1 /f; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat&quot; /v AITEnable /t REG_DWORD /d 0 /f; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat&quot; /v DisableInventory /t REG_DWORD /d 1 /f; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat&quot; /v DisableUCA /t REG_DWORD /d 1 /f; };
    { reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection&quot; /v AllowTelemetry /t REG_DWORD /d 0 /f; };
    # Disable Ads and Suggestions
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo&quot; /v DisabledByGroupPolicy /t REG_DWORD /d 1 /f; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent&quot; /v DisableWindowsSpotlightFeatures /t REG_DWORD /d 1 /f; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent&quot; /v DisableThirdPartySuggestions /t REG_DWORD /d 1 /f; };
    # Disable Prefetch and SysMain (Superfetch)
    { reg.exe add &quot;HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters&quot; /v EnablePrefetcher /t REG_DWORD /d 0 /f; };
    { reg.exe add &quot;HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters&quot; /v EnableSuperfetch /t REG_DWORD /d 0 /f; };
    # Disable Background Apps (UWP) globally to reduce Task Manager clutter
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy&quot; /v LetAppsRunInBackground /t REG_DWORD /d 2 /f; };
    # Completely disable SmartScreen
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\System&quot; /v EnableSmartScreen /t REG_DWORD /d 0 /f; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\SmartScreen&quot; /v ConfigureAppInstallControl /t REG_SZ /d &quot;Anywhere&quot; /f; };
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\SmartScreen&quot; /v ConfigureAppInstallControlEnabled /t REG_DWORD /d 0 /f; };
    # Force Offline OOBE (BypassNRO)
    { reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE&quot; /v BypassNRO /t REG_DWORD /d 1 /f; };
    # Disable OOBE Privacy Experience to stop internet delays
    { reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\OOBE&quot; /v DisablePrivacyExperience /t REG_DWORD /d 1 /f; };
    # Extreme Performance / Animation Kills
    {
        reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation&quot; /v Manufacturer /t REG_SZ /d &quot;WinAurex&quot; /f;
        reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation&quot; /v Model /t REG_SZ /d &quot;WinAurex 11 OS Pro&quot; /f;
        reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation&quot; /v SupportPhone /t REG_SZ /d &quot;+91 7778906798&quot; /f;
                reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation&quot; /v SupportURL /t REG_SZ /d &quot;wa.me/917778906798&quot; /f;
        reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation&quot; /v SupportHours /t REG_SZ /d &quot;Mon-Fri 9AM-5PM&quot; /f;
        reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation&quot; /v Logo /t REG_SZ /d &quot;C:\Windows\System32\oemlogo.bmp&quot; /f;
        reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation&quot; /v Author /t REG_SZ /d &quot;Farhan Shaikh&quot; /f;
        reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation&quot; /v &quot;Author Info&quot; /t REG_SZ /d &quot;https://github.com/YTxFSGAMERz&quot; /f;
    };
    {
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ControlAnimations&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\AnimateMinMax&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TaskbarAnimations&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DWMAeroPeekEnabled&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\MenuAnimation&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TooltipAnimation&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\SelectionFade&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DWMSaveThumbnailEnabled&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\CursorShadow&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ThumbnailsOrIcon&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewAlphaSelect&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ComboBoxAnimation&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListBoxSmoothScrolling&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
		Set-ItemProperty -LiteralPath &quot;Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DropShadow&quot; -Name &apos;DefaultValue&apos; -Value 0 -Type &apos;DWord&apos; -Force;
	};
    # Kill Scheduled Tasks
    {
        Get-ScheduledTask | Where-Object {$_.TaskPath -like &quot;*Microsoft\Windows\Windows Defender*&quot;} | Disable-ScheduledTask -ErrorAction SilentlyContinue;
        Get-ScheduledTask | Where-Object {$_.TaskPath -like &quot;*Microsoft\Windows\Customer Experience Improvement Program*&quot;} | Disable-ScheduledTask -ErrorAction SilentlyContinue;
        Get-ScheduledTask | Where-Object {$_.TaskPath -like &quot;*Microsoft\Windows\Application Experience*&quot;} | Disable-ScheduledTask -ErrorAction SilentlyContinue;
        Get-ScheduledTask | Where-Object {$_.TaskPath -like &quot;*Microsoft\Windows\Autochk*&quot;} | Disable-ScheduledTask -ErrorAction SilentlyContinue;
        Get-ScheduledTask | Where-Object {$_.TaskPath -like &quot;*Microsoft\Windows\Maintenance*&quot;} | Disable-ScheduledTask -ErrorAction SilentlyContinue;
        Get-ScheduledTask | Where-Object {$_.TaskPath -like &quot;*Microsoft\Windows\TextServicesFramework*&quot;} | Disable-ScheduledTask -ErrorAction SilentlyContinue;
    };
);
&amp; { foreach( $script in $regTweaks ) { &amp; $script } } *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; &quot;C:\Windows\Setup\Scripts\MegaTweaks.log&quot;;

# =====================================================================
# DYNAMIC OEM BRANDING &amp; WALLPAPERS
# =====================================================================
Write-Host &quot;Searching for OEM Info folder on attached drives...&quot;
$drives = Get-Volume | Where-Object { $_.DriveType -eq &apos;Removable&apos; -or $_.DriveType -eq &apos;CD-ROM&apos; -or $_.DriveType -eq &apos;Fixed&apos; }
foreach ($drive in $drives) {
    if ($drive.DriveLetter) {
        $oemPath = &quot;$($drive.DriveLetter):\OEM Info&quot;
        if (Test-Path $oemPath) {
            Write-Host &quot;Found OEM Info at $oemPath. Copying files...&quot;
            if (Test-Path &quot;$oemPath\img0.jpg&quot;) {
                Copy-Item -Path &quot;$oemPath\img0.jpg&quot; -Destination &quot;C:\Windows\Web\Wallpaper\Windows\img0.jpg&quot; -Force
                Copy-Item -Path &quot;$oemPath\img0.jpg&quot; -Destination &quot;C:\Windows\Web\Wallpaper\Windows\img0_3840x2160.jpg&quot; -Force
            }
            if (Test-Path &quot;$oemPath\img19.jpg&quot;) {
                Copy-Item -Path &quot;$oemPath\img19.jpg&quot; -Destination &quot;C:\Windows\Web\Wallpaper\Windows\img19.jpg&quot; -Force
                Copy-Item -Path &quot;$oemPath\img19.jpg&quot; -Destination &quot;C:\Windows\Web\Wallpaper\Windows\img19_3840x2160.jpg&quot; -Force
            }
            if (Test-Path &quot;$oemPath\oemlogo.bmp&quot;) {
                Copy-Item -Path &quot;$oemPath\oemlogo.bmp&quot; -Destination &quot;C:\Windows\System32\oemlogo.bmp&quot; -Force
            }
            break
        }
    }
}

# =====================================================================
# APPLY EXTRACTED TWEAKS
# =====================================================================
Write-Host &quot;Applying Extracted Registry Tweaks...&quot;
Get-ChildItem -Path &quot;C:\Windows\Setup\Scripts\Tweaks&quot; -Filter &quot;*.reg&quot; -Recurse | ForEach-Object { reg.exe import $_.FullName }

Write-Host &quot;Applying Extracted Batch Tweaks...&quot;
Get-ChildItem -Path &quot;C:\Windows\Setup\Scripts\Tweaks&quot; -Filter &quot;*.bat&quot; -Recurse | ForEach-Object { cmd.exe /c $_.FullName }
Get-ChildItem -Path &quot;C:\Windows\Setup\Scripts\Tweaks&quot; -Filter &quot;*.cmd&quot; -Recurse | ForEach-Object { cmd.exe /c $_.FullName }

Write-Host &quot;Applying Extracted PowerShell Tweaks...&quot;
Get-ChildItem -Path &quot;C:\Windows\Setup\Scripts\Tweaks&quot; -Filter &quot;*.ps1&quot; -Recurse | ForEach-Object { &amp; $_.FullName -Force }
    

    </File>
    <File path="C:\Windows\Setup\Scripts\UserOnce.ps1">
$scripts = @(
	{ reg.exe add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /ve /f; };
	{ Set-ItemProperty -LiteralPath 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name 'LaunchTo' -Type 'DWord' -Value 1; };
	{ Set-ItemProperty -LiteralPath 'Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects' -Name 'VisualFXSetting' -Type 'DWord' -Value 2 -Force; };
	{ Get-Process -Name 'explorer' -ErrorAction 'SilentlyContinue' | Where-Object -FilterScript { $_.SessionId -eq ( Get-Process -Id $PID ).SessionId; } | Stop-Process -Force; };
);
&amp; { foreach( $script in $scripts ) { &amp; $script } } *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; "$env:TEMP\UserOnce.log";
    </File>
    <File path="C:\Windows\Setup\Scripts\DefaultUser.ps1">
$scripts = @(
	{ reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\WindowsCopilot" /v TurnOffWindowsCopilot /t REG_DWORD /d 1 /f; };
	{ reg.exe add "HKU\DefaultUser\Software\Microsoft\Notepad" /v ShowStoreBanner /t REG_DWORD /d 0 /f; };
	{ Remove-ItemProperty -LiteralPath 'Registry::HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Run' -Name 'OneDriveSetup' -Force -ErrorAction 'Continue'; };
	{ reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Hidden" /t REG_DWORD /d 1 /f; };
	{ reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowSuperHidden" /t REG_DWORD /d 1 /f; };
	{ reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarAl /t REG_DWORD /d 0 /f; };
	{ reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\Explorer" /v DisableSearchBoxSuggestions /t REG_DWORD /d 1 /f; };
	{ reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v "UnattendedSetup" /t REG_SZ /d "powershell.exe -WindowStyle \"Normal\" -ExecutionPolicy \"Unrestricted\" -NoProfile -File \"C:\Windows\Setup\Scripts\UserOnce.ps1\"" /f; };
);
&amp; { foreach( $script in $scripts ) { &amp; $script } } *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; "C:\Windows\Setup\Scripts\DefaultUser.log";
    </File>
    <File path="C:\Windows\Setup\Scripts\FirstLogon.ps1">
$scripts = @(
	{ Set-ItemProperty -LiteralPath 'Registry::HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name 'AutoLogonCount' -Type 'DWord' -Force -Value 0; };
	{ Disable-ComputerRestore -Drive 'C:\'; };
	{ cmd.exe /c "rmdir C:\Windows.old"; };
    { iex "&amp; { $(irm https://massgrave.dev/get) } /HWID" };
	{ Remove-Item -LiteralPath @('C:\Windows\Panther\unattend.xml', 'C:\Windows\Panther\unattend-original.xml') -Force -ErrorAction 'SilentlyContinue'; };
);
&amp; { foreach( $script in $scripts ) { &amp; $script } } *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; "C:\Windows\Setup\Scripts\FirstLogon.log";
    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Apply Optimizations.bat">
@echo off
title PC Optimizer Farhan
setlocal enabledelayedexpansion

:: BatchGotAdmin
REM  --&gt; Check for permissions
    IF &quot;%PROCESSOR_ARCHITECTURE%&quot; EQU &quot;amd64&quot; (
&gt;nul 2&gt;&amp;1 &quot;%SYSTEMROOT%\SysWOW64\cacls.exe&quot; &quot;%SYSTEMROOT%\SysWOW64\config\system&quot;
) ELSE (
&gt;nul 2&gt;&amp;1 &quot;%SYSTEMROOT%\system32\cacls.exe&quot; &quot;%SYSTEMROOT%\system32\config\system&quot;
)

REM --&gt; If error flag set, we do not have admin.
if &apos;%errorlevel%&apos; NEQ &apos;0&apos; (
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^(&quot;Shell.Application&quot;^) &gt; &quot;%temp%\getadmin.vbs&quot;
    set params= %*
    echo UAC.ShellExecute &quot;cmd.exe&quot;, &quot;/c &quot;&quot;%~s0&quot;&quot; %params:&quot;=&quot;&quot;&quot;%&quot;, &quot;&quot;, &quot;runas&quot;, 1 &gt;&gt; &quot;%temp%\getadmin.vbs&quot;

    cscript //nologo &quot;%temp%\getadmin.vbs&quot;
    del &quot;%temp%\getadmin.vbs&quot;
    exit /B

:gotAdmin
    pushd &quot;%CD%&quot;
    CD /D &quot;%~dp0&quot; 

:start
cls
echo.
echo --------------------------------------------------
echo                   Optimizer
echo --------------------------------------------------
echo.

:: Options to select
echo *1.- Apply Recommended Optimizations
echo *2.- System Optimizations
echo *3.- Create Restore Point (Recommended)
echo *4.- Delete temporary files
echo.
echo === Reducing svchost processes ===
for /f &quot;delims=&quot; %%i in (&apos;powershell -NoProfile -Command &quot;(Get-CimInstance Win32_OperatingSystem).TotalVisibleMemorySize&quot;&apos;) do set MEM=%%i
set /a RAM=%MEM% + 1024000
reg add &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control&quot; /v &quot;SvcHostSplitThresholdInKB&quot; /t REG_DWORD /d &quot;%RAM%&quot; /f 2&gt;nul

echo.
echo === Disabling Wifi Sense ===
reg add &quot;HKLM\Software\Microsoft\PolicyManager\default\WiFi&quot; /v AllowWiFiHotSpotReporting /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKLM\Software\Microsoft\PolicyManager\default\WiFi&quot; /v AllowAutoConnectToWiFiSenseHotspots /t REG_DWORD /d 0 /f 2&gt;nul

echo.
echo === Disabling Windows Update Tasks ===
schtasks /Change /TN &quot;\Microsoft\Windows\InstallService\*&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;\Microsoft\Windows\UpdateOrchestrator\*&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;\Microsoft\Windows\UpdateAssistant\*&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;\Microsoft\Windows\WaaSMedic\*&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;\Microsoft\Windows\WindowsUpdate\*&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;\Microsoft\WindowsUpdate\*&quot; /Disable 2&gt;nul

echo.
echo === Optimizing Visual Section ===
reg add &quot;HKCU\Control Panel\Desktop&quot; /v DragFullWindows /t REG_SZ /d 0 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v MenuShowDelay /t REG_SZ /d 200 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v MinAnimate /t REG_SZ /d 0 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v KeyboardDelay /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v ListviewAlphaSelect /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v ListviewShadow /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v TaskbarAnimations /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v VisualFXSetting /t REG_DWORD /d 3 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v EnableAeroPeek /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v MenuShowDelay /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v AutoEndTasks /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize&quot; /v &quot;EnableTransparency&quot; /t REG_DWORD /d &quot;0&quot; /f 2&gt;nul

echo.
echo === Disabling Teredo ===
netsh interface teredo set state disabled

echo.
echo === Disabling Telemetry Tasks ===
schtasks /Change /TN &quot;Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;Microsoft\Windows\Application Experience\ProgramDataUpdater&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;Microsoft\Windows\Autochk\Proxy&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;Microsoft\Windows\Customer Experience Improvement Program\Consolidator&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;Microsoft\Windows\Customer Experience Improvement Program\UsbCeip&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;Microsoft\Windows\Feedback\Siuf\DmClient&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;Microsoft\Windows\Windows Error Reporting\QueueReporting&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;Microsoft\Windows\Application Experience\MareBackup&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;Microsoft\Windows\Application Experience\StartupAppTask&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;Microsoft\Windows\Application Experience\PcaPatchDbTask&quot; /Disable 2&gt;nul
schtasks /Change /TN &quot;Microsoft\Windows\Maps\MapsUpdateTask&quot; /Disable 2&gt;nul

echo.
echo === Disabling Telemetry Registry ===
reg add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection&quot; /v AllowTelemetry /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection&quot; /v AllowTelemetry /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKCU\SOFTWARE\Microsoft\Siuf\Rules&quot; /v NumberOfSIUFInPeriod /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection&quot; /v DoNotShowFeedbackNotifications /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKCU\SOFTWARE\Policies\Microsoft\Windows\CloudContent&quot; /v DisableTailoredExperiencesWithDiagnosticData /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo&quot; /v DisabledByGroupPolicy /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting&quot; /v Disabled /t REG_DWORD /d 1 /f 2&gt;nul

echo.
echo === Applying Registry Tweaks ===
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games&quot; /v &quot;Affinity&quot; /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games&quot; /v &quot;Background Only&quot; /t REG_SZ /d &quot;False&quot; /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games&quot; /v &quot;Clock Rate&quot; /t REG_DWORD /d 10000 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games&quot; /v &quot;GPU Priority&quot; /t REG_DWORD /d 8 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games&quot; /v &quot;Priority&quot; /t REG_DWORD /d 6 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games&quot; /v &quot;Scheduling Category&quot; /t REG_SZ /d &quot;High&quot; /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games&quot; /v &quot;SFIO Priority&quot; /t REG_SZ /d &quot;High&quot; /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters&quot; /v &quot;MaxCmds&quot; /t REG_DWORD /d 100 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters&quot; /v &quot;MaxThreads&quot; /t REG_DWORD /d 100 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters&quot; /v &quot;MaxCollectionCount&quot; /t REG_DWORD /d 32 /f 2&gt;nul
reg add &quot;HKLM\SYSTEM\CurrentControlSet\Control\FileSystem&quot; /v LongPathsEnabled /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching&quot; /v SearchOrderConfig /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile&quot; /v SystemResponsiveness /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile&quot; /v NetworkThrottlingIndex /t REG_DWORD /d 4294967295 /f 2&gt;nul
reg add &quot;HKLM\SYSTEM\ControlSet001\Services\Ndu&quot; /v Start /t REG_DWORD /d 2 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Mouse&quot; /v MouseHoverTime /t REG_SZ /d &quot;400&quot; /f 2&gt;nul
reg add &quot;HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters&quot; /v IRPStackSize /t REG_DWORD /d 30 /f 2&gt;nul
reg add &quot;HKCU\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds&quot; /v EnableFeeds /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Feeds&quot; /v ShellFeedsTaskbarViewMode /t REG_DWORD /d 2 /f 2&gt;nul
reg add &quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer&quot; /v HideSCAMeetNow /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKCU\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement&quot; /v ScoobeSystemSettingEnabled /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKLM\SYSTEM\CurrentControlSet\Control\GraphicsDrivers&quot; /v &quot;HwSchMode&quot; /t REG_DWORD /d &quot;2&quot; /f 2&gt;nul

echo.
echo === Setting services to manual ===
sc config &quot;AJRouter&quot; start= demand 2&gt;nul
sc config &quot;ALG&quot; start= demand 2&gt;nul
sc config &quot;AppIDSvc&quot; start= demand 2&gt;nul
sc config &quot;AppMgmt&quot; start= demand 2&gt;nul
sc config &quot;AppReadiness&quot; start= demand 2&gt;nul
sc config &quot;AppXSvc&quot; start= demand 2&gt;nul
sc config &quot;Appinfo&quot; start= demand 2&gt;nul
sc config &quot;AssignedAccessManagerSvc&quot; start= demand 2&gt;nul
sc config &quot;AxInstSV&quot; start= demand 2&gt;nul
sc config &quot;BDESVC&quot; start= demand 2&gt;nul
sc config &quot;BTAGService&quot; start= demand 2&gt;nul
sc config &quot;BcastDVRUserService_*&quot; start= demand 2&gt;nul
sc config &quot;BluetoothUserService_*&quot; start= demand 2&gt;nul
sc config &quot;Browser&quot; start= demand 2&gt;nul
sc config &quot;CaptureService_*&quot; start= demand 2&gt;nul
sc config &quot;CertPropSvc&quot; start= demand 2&gt;nul
sc config &quot;ClipSVC&quot; start= demand 2&gt;nul
sc config &quot;ConsentUxUserSvc_*&quot; start= demand 2&gt;nul
sc config &quot;CredentialEnrollmentManagerUserSvc_*&quot; start= demand 2&gt;nul
sc config &quot;CscService&quot; start= demand 2&gt;nul
sc config &quot;DcpSvc&quot; start= demand 2&gt;nul
sc config &quot;DevQueryBroker&quot; start= demand 2&gt;nul
sc config &quot;DeviceAssociationBrokerSvc_*&quot; start= demand 2&gt;nul
sc config &quot;DeviceAssociationService&quot; start= demand 2&gt;nul
sc config &quot;DeviceInstall&quot; start= demand 2&gt;nul
sc config &quot;DevicePickerUserSvc_*&quot; start= demand 2&gt;nul
sc config &quot;DevicesFlowUserSvc_*&quot; start= demand 2&gt;nul
sc config &quot;DisplayEnhancementService&quot; start= demand 2&gt;nul
sc config &quot;DmEnrollmentSvc&quot; start= demand 2&gt;nul
sc config &quot;DsSvc&quot; start= demand 2&gt;nul
sc config &quot;DsmSvc&quot; start= demand 2&gt;nul
sc config &quot;EFS&quot; start= demand 2&gt;nul
sc config &quot;EapHost&quot; start= demand 2&gt;nul
sc config &quot;EntAppSvc&quot; start= demand 2&gt;nul
sc config &quot;FDResPub&quot; start= demand 2&gt;nul
sc config &quot;Fax&quot; start= demand 2&gt;nul
sc config &quot;FrameServer&quot; start= demand 2&gt;nul
sc config &quot;FrameServerMonitor&quot; start= demand 2&gt;nul
sc config &quot;GraphicsPerfSvc&quot; start= demand 2&gt;nul
sc config &quot;HomeGroupListener&quot; start= demand 2&gt;nul
sc config &quot;HomeGroupProvider&quot; start= demand 2&gt;nul
sc config &quot;HvHost&quot; start= demand 2&gt;nul
sc config &quot;IEEtwCollectorService&quot; start= demand 2&gt;nul
sc config &quot;IKEEXT&quot; start= demand 2&gt;nul
sc config &quot;InstallService&quot; start= demand 2&gt;nul
sc config &quot;InventorySvc&quot; start= demand 2&gt;nul
sc config &quot;IpxlatCfgSvc&quot; start= demand 2&gt;nul
sc config &quot;KtmRm&quot; start= demand 2&gt;nul
sc config &quot;LicenseManager&quot; start= demand 2&gt;nul
sc config &quot;LxpSvc&quot; start= demand 2&gt;nul
sc config &quot;MSDTC&quot; start= demand 2&gt;nul
sc config &quot;MSiSCSI&quot; start= demand 2&gt;nul
sc config &quot;McpManagementService&quot; start= demand 2&gt;nul
sc config &quot;MessagingService_*&quot; start= demand 2&gt;nul
sc config &quot;MicrosoftEdgeElevationService&quot; start= demand 2&gt;nul
sc config &quot;MixedRealityOpenXRSvc&quot; start= demand 2&gt;nul
sc config &quot;NPSMSvc_*&quot; start= demand 2&gt;nul
sc config &quot;NaturalAuthentication&quot; start= demand 2&gt;nul
sc config &quot;NcaSvc&quot; start= demand 2&gt;nul
sc config &quot;NcbService&quot; start= demand 2&gt;nul
sc config &quot;NcdAutoSetup&quot; start= demand 2&gt;nul
sc config &quot;NetSetupSvc&quot; start= demand 2&gt;nul
sc config &quot;Netman&quot; start= demand 2&gt;nul
sc config &quot;NgcCtnrSvc&quot; start= demand 2&gt;nul
sc config &quot;NgcSvc&quot; start= demand 2&gt;nul
sc config &quot;NlaSvc&quot; start= demand 2&gt;nul
sc config &quot;P9RdrService_*&quot; start= demand 2&gt;nul
sc config &quot;PNRPAutoReg&quot; start= demand 2&gt;nul
sc config &quot;PNRPsvc&quot; start= demand 2&gt;nul
sc config &quot;PeerDistSvc&quot; start= demand 2&gt;nul
sc config &quot;PenService_*&quot; start= demand 2&gt;nul
sc config &quot;PerfHost&quot; start= demand 2&gt;nul
sc config &quot;PhoneSvc&quot; start= demand 2&gt;nul
sc config &quot;PimIndexMaintenanceSvc_*&quot; start= demand 2&gt;nul
sc config &quot;PlugPlay&quot; start= demand 2&gt;nul
sc config &quot;PolicyAgent&quot; start= demand 2&gt;nul
sc config &quot;PrintNotify&quot; start= demand 2&gt;nul
sc config &quot;PrintWorkflowUserSvc_*&quot; start= demand 2&gt;nul
sc config &quot;PushToInstall&quot; start= demand 2&gt;nul
sc config &quot;QWAVE&quot; start= demand 2&gt;nul
sc config &quot;RasAuto&quot; start= demand 2&gt;nul
sc config &quot;RasMan&quot; start= demand 2&gt;nul
sc config &quot;RetailDemo&quot; start= demand 2&gt;nul
sc config &quot;RmSvc&quot; start= demand 2&gt;nul
sc config &quot;RpcLocator&quot; start= demand 2&gt;nul
sc config &quot;SCPolicySvc&quot; start= demand 2&gt;nul
sc config &quot;SCardSvr&quot; start= demand 2&gt;nul
sc config &quot;SDRSVC&quot; start= demand 2&gt;nul
sc config &quot;SEMgrSvc&quot; start= demand 2&gt;nul
sc config &quot;SNMPTRAP&quot; start= demand 2&gt;nul
sc config &quot;SNMPTrap&quot; start= demand 2&gt;nul
sc config &quot;SSDPSRV&quot; start= demand 2&gt;nul
sc config &quot;ScDeviceEnum&quot; start= demand 2&gt;nul
sc config &quot;SecurityHealthService&quot; start= demand 2&gt;nul
sc config &quot;Sense&quot; start= demand 2&gt;nul
sc config &quot;SensorDataService&quot; start= demand 2&gt;nul
sc config &quot;SensorService&quot; start= demand 2&gt;nul
sc config &quot;SensrSvc&quot; start= demand 2&gt;nul
sc config &quot;SessionEnv&quot; start= demand 2&gt;nul
sc config &quot;SharedAccess&quot; start= demand 2&gt;nul
sc config &quot;SharedRealitySvc&quot; start= demand 2&gt;nul
sc config &quot;SmsRouter&quot; start= demand 2&gt;nul
sc config &quot;SstpSvc&quot; start= demand 2&gt;nul
sc config &quot;StiSvc&quot; start= demand 2&gt;nul
sc config &quot;TabletInputService&quot; start= demand 2&gt;nul
sc config &quot;TapiSrv&quot; start= demand 2&gt;nul
sc config &quot;TieringEngineService&quot; start= demand 2&gt;nul
sc config &quot;TimeBroker&quot; start= demand 2&gt;nul
sc config &quot;TimeBrokerSvc&quot; start= demand 2&gt;nul
sc config &quot;TokenBroker&quot; start= demand 2&gt;nul
sc config &quot;TroubleshootingSvc&quot; start= demand 2&gt;nul
sc config &quot;TrustedInstaller&quot; start= demand 2&gt;nul
sc config &quot;UI0Detect&quot; start= demand 2&gt;nul
sc config &quot;UdkUserSvc_*&quot; start= demand 2&gt;nul
sc config &quot;UmRdpService&quot; start= demand 2&gt;nul
sc config &quot;UnistoreSvc_*&quot; start= demand 2&gt;nul
sc config &quot;UserDataSvc_*&quot; start= demand 2&gt;nul
sc config &quot;VSS&quot; start= demand 2&gt;nul
sc config &quot;VacSvc&quot; start= demand 2&gt;nul
sc config &quot;W32Time&quot; start= demand 2&gt;nul
sc config &quot;WEPHOSTSVC&quot; start= demand 2&gt;nul
sc config &quot;WFDSConMgrSvc&quot; start= demand 2&gt;nul
sc config &quot;WMPNetworkSvc&quot; start= demand 2&gt;nul
sc config &quot;WManSvc&quot; start= demand 2&gt;nul
sc config &quot;WPDBusEnum&quot; start= demand 2&gt;nul
sc config &quot;WSService&quot; start= demand 2&gt;nul
sc config &quot;WaaSMedicSvc&quot; start= demand 2&gt;nul
sc config &quot;WalletService&quot; start= demand 2&gt;nul
sc config &quot;WarpJITSvc&quot; start= demand 2&gt;nul
sc config &quot;WbioSrvc&quot; start= demand 2&gt;nul
sc config &quot;WcsPlugInService&quot; start= demand 2&gt;nul
sc config &quot;WdNisSvc&quot; start= demand 2&gt;nul
sc config &quot;WdiServiceHost&quot; start= demand 2&gt;nul
sc config &quot;WdiSystemHost&quot; start= demand 2&gt;nul
sc config &quot;WebClient&quot; start= demand 2&gt;nul
sc config &quot;Wecsvc&quot; start= demand 2&gt;nul
sc config &quot;WerSvc&quot; start= demand 2&gt;nul
sc config &quot;WiaRpc&quot; start= demand 2&gt;nul
sc config &quot;WinHttpAutoProxySvc&quot; start= demand 2&gt;nul
sc config &quot;WinRM&quot; start= demand 2&gt;nul
sc config &quot;WpcMonSvc&quot; start= demand 2&gt;nul
sc config &quot;XblAuthManager&quot; start= demand 2&gt;nul
sc config &quot;XblGameSave&quot; start= demand 2&gt;nul
sc config &quot;XboxGipSvc&quot; start= demand 2&gt;nul
sc config &quot;XboxNetApiSvc&quot; start= demand 2&gt;nul
sc config &quot;autotimesvc&quot; start= demand 2&gt;nul
sc config &quot;bthserv&quot; start= demand 2&gt;nul
sc config &quot;camsvc&quot; start= demand 2&gt;nul
sc config &quot;cloudidsvc&quot; start= demand 2&gt;nul
sc config &quot;dcsvc&quot; start= demand 2&gt;nul
sc config &quot;defragsvc&quot; start= demand 2&gt;nul
sc config &quot;diagnosticshub.standardcollector.service&quot; start= demand 2&gt;nul
sc config &quot;diagsvc&quot; start= demand 2&gt;nul
sc config &quot;dmwappushservice&quot; start= demand 2&gt;nul
sc config &quot;dot3svc&quot; start= demand 2&gt;nul
sc config &quot;edgeupdate&quot; start= demand 2&gt;nul
sc config &quot;edgeupdatem&quot; start= demand 2&gt;nul
sc config &quot;embeddedmode&quot; start= demand 2&gt;nul
sc config &quot;fdPHost&quot; start= demand 2&gt;nul
sc config &quot;fhsvc&quot; start= demand 2&gt;nul
sc config &quot;hidserv&quot; start= demand 2&gt;nul
sc config &quot;icssvc&quot; start= demand 2&gt;nul
sc config &quot;lfsvc&quot; start= demand 2&gt;nul
sc config &quot;lltdsvc&quot; start= demand 2&gt;nul
sc config &quot;lmhosts&quot; start= demand 2&gt;nul
sc config &quot;msiserver&quot; start= demand 2&gt;nul
sc config &quot;netprofm&quot; start= demand 2&gt;nul
sc config &quot;p2pimsvc&quot; start= demand 2&gt;nul
sc config &quot;p2psvc&quot; start= demand 2&gt;nul
sc config &quot;perceptionsimulation&quot; start= demand 2&gt;nul
sc config &quot;pla&quot; start= demand 2&gt;nul
sc config &quot;seclogon&quot; start= demand 2&gt;nul
sc config &quot;smphost&quot; start= demand 2&gt;nul
sc config &quot;spectrum&quot; start= demand 2&gt;nul
sc config &quot;svsvc&quot; start= demand 2&gt;nul
sc config &quot;swprv&quot; start= demand 2&gt;nul
sc config &quot;upnphost&quot; start= demand 2&gt;nul
sc config &quot;vds&quot; start= demand 2&gt;nul
sc config &quot;vmicguestinterface&quot; start= demand 2&gt;nul
sc config &quot;vmicheartbeat&quot; start= demand 2&gt;nul
sc config &quot;vmickvpexchange&quot; start= demand 2&gt;nul
sc config &quot;vmicrdv&quot; start= demand 2&gt;nul
sc config &quot;vmicshutdown&quot; start= demand 2&gt;nul
sc config &quot;vmictimesync&quot; start= demand 2&gt;nul
sc config &quot;vmicvmsession&quot; start= demand 2&gt;nul
sc config &quot;vmicvss&quot; start= demand 2&gt;nul
sc config &quot;vmvss&quot; start= demand 2&gt;nul
sc config &quot;wbengine&quot; start= demand 2&gt;nul
sc config &quot;wcncsvc&quot; start= demand 2&gt;nul
sc config &quot;webthreatdefsvc&quot; start= demand 2&gt;nul
sc config &quot;wercplsupport&quot; start= demand 2&gt;nul
sc config &quot;wisvc&quot; start= demand 2&gt;nul
sc config &quot;wlidsvc&quot; start= demand 2&gt;nul
sc config &quot;wlpasvc&quot; start= demand 2&gt;nul
sc config &quot;wmiApSrv&quot; start= demand 2&gt;nul
sc config &quot;workfolderssvc&quot; start= demand 2&gt;nul
sc config &quot;wuauserv&quot; start= demand 2&gt;nul
sc config &quot;wudfsvc&quot; start= demand 2&gt;nul

echo.
echo === Disabling Services ===
sc config &quot;diagnosticshub.standardcollector.service&quot; start= disabled 2&gt;nul
sc config &quot;DiagTrack&quot; start= disabled 2&gt;nul
sc config &quot;DPS&quot; start= disabled 2&gt;nul
sc config &quot;FontCache&quot; start= disabled 2&gt;nul
sc config &quot;FontCache3.0.0.0&quot; start= disabled 2&gt;nul
sc config &quot;SystemUsageReportSvc_QUEENCREEK&quot; start= disabled 2&gt;nul
sc config &quot;GpuEnergyDrv&quot; start= disabled 2&gt;nul
sc config &quot;ShellHWDetection&quot; start= disabled 2&gt;nul
sc config &quot;SgrmAgent&quot; start= disabled 2&gt;nul
sc config &quot;SgrmBroker&quot; start= disabled 2&gt;nul
sc config &quot;uhssvc&quot; start= disabled 2&gt;nul
sc config &quot;TrkWks&quot; start= disabled 2&gt;nul
sc config &quot;WdiServiceHost&quot; start= disabled 2&gt;nul
sc config &quot;WdiSystemHost&quot; start= disabled 2&gt;nul
sc config &quot;WSearch&quot; start= disabled 2&gt;nul
sc config &quot;diagsvc&quot; start= disabled 2&gt;nul

echo === Clearing DNS cache ===
echo.
ipconfig /flushdns 2&gt;nul

echo.
echo === Applying Repository Master Recommended Profile ===
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command &quot;Write-Host &apos;Applying Workstation Master Profile (Recommended)...&apos;; &amp; &apos;%~dp0Profiles\Apply_Workstation_Master_Profile.ps1&apos; -Force&quot;

timeout /t 3 /nobreak
goto :done

:temp
echo.
echo Deleting Temporary Files...
del /S /F /Q &quot;%temp%&quot;
del /S /F /Q &quot;%WINDIR%\Temp\*.*&quot;
del /S /F /Q &quot;%WINDIR%\Prefetch\*.*&quot; 
echo.
goto :done

:restorepoint
cls

echo.
echo Creating restore point...
&quot;powershell.exe&quot; Enable-ComputerRestore -Drive &quot;%SystemDrive%&quot;
&quot;powershell.exe&quot; -Command &quot;Checkpoint-Computer -Description &apos;Optimizer Script&apos;&quot;
goto :start

:defender
cls

echo --------------------------------------------------
echo                   Optimizer
echo --------------------------------------------------
echo.

:: Options to select
echo *1.- Disable Defender
echo *2.- Enable Defender
echo *3.- Go Back.
echo.

:: Code to go to menu with Options
set /p oput=Option: 
if &quot;%oput%&quot;==&quot;1&quot; goto :DF
if &quot;%oput%&quot;==&quot;2&quot; goto :DE
if &quot;%oput%&quot;==&quot;3&quot; goto :Start
if &quot;%oput%&quot;==&quot;&quot; goto :Start



:DF
cls
echo.
echo --------------------------------------------------
echo        Disabling Windows Defender
echo --------------------------------------------------
echo.
reg add &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinDefend&quot; /v &quot;Start&quot; /t REG_DWORD /d 4 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService&quot; /v &quot;Start&quot; /t REG_DWORD /d 4 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdNisSvc&quot; /v &quot;Start&quot; /t REG_DWORD /d 4 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sense&quot; /v &quot;Start&quot; /t REG_DWORD /d 4 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wscsvc&quot; /v &quot;Start&quot; /t REG_DWORD /d 4 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender&quot; /v &quot;DisableAntiSpyware&quot; /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender&quot; /v &quot;DisableRoutinelyTakingAction&quot; /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender&quot; /v &quot;ServiceKeepAlive&quot; /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection&quot; /v &quot;DisableBehaviorMonitoring&quot; /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection&quot; /v &quot;DisableIOAVProtection&quot; /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection&quot; /v &quot;DisableOnAccessProtection&quot; /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection&quot; /v &quot;DisableRealtimeMonitoring&quot; /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting&quot; /v &quot;DisableEnhancedNotifications&quot; /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Notifications&quot; /v &quot;DisableNotifications&quot; /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications&quot; /v &quot;NoToastApplicationNotification&quot; /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications&quot; /v &quot;NoToastApplicationNotificationOnLockScreen&quot; /t REG_DWORD /d 1 /f 2&gt;nul
timeout /t 3 /nobreak
exit /b



:DE
cls
echo.
echo --------------------------------------------------
echo            Enabling Windows Defender.
echo --------------------------------------------------
echo.
reg add &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinDefend&quot; /v &quot;Start&quot; /t REG_DWORD /d 2 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService&quot; /v &quot;Start&quot; /t REG_DWORD /d 2 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdNisSvc&quot; /v &quot;Start&quot; /t REG_DWORD /d 2 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sense&quot; /v &quot;Start&quot; /t REG_DWORD /d 2 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wscsvc&quot; /v &quot;Start&quot; /t REG_DWORD /d 2 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender&quot; /v &quot;DisableAntiSpyware&quot; /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender&quot; /v &quot;DisableRoutinelyTakingAction&quot; /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender&quot; /v &quot;ServiceKeepAlive&quot; /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection&quot; /v &quot;DisableBehaviorMonitoring&quot; /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection&quot; /v &quot;DisableIOAVProtection&quot; /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection&quot; /v &quot;DisableOnAccessProtection&quot; /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection&quot; /v &quot;DisableRealtimeMonitoring&quot; /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting&quot; /v &quot;DisableEnhancedNotifications&quot; /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Notifications&quot; /v &quot;DisableNotifications&quot; /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications&quot; /v &quot;NoToastApplicationNotification&quot; /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications&quot; /v &quot;NoToastApplicationNotificationOnLockScreen&quot; /t REG_DWORD /d 0 /f 2&gt;nul
timeout /t 3 /nobreak
exit /b

:optitweakspc
cls

echo --------------------------------------------------
echo                   Optimizer
echo --------------------------------------------------
echo.

:: Options to select
echo *1.- Set services to Manual
echo *2.- Disable Fullscreen Optimizations
echo *3.- Disable Telemetry
echo *4.- Disable unnecessary services
echo *5.- Disable background apps
echo *6.- Reduce Windows quality
echo *7.- High priority for Games
echo *8.- Reduce svchost processes
echo *9.- Disable GameDVR
echo *10.- Go Back
echo.

:: Options
set /p optwkpc=Option: 
if &quot;%optwkpc%&quot;==&quot;&quot; goto :start
if &quot;%optwkpc%&quot;==&quot;1&quot; goto :servicemanual
if &quot;%optwkpc%&quot;==&quot;2&quot; goto :disablefullscreenoptimizations
if &quot;%optwkpc%&quot;==&quot;3&quot; goto :disabletelemetry
if &quot;%optwkpc%&quot;==&quot;4&quot; goto :disableservices
if &quot;%optwkpc%&quot;==&quot;5&quot; goto :disablebackgroundapps
if &quot;%optwkpc%&quot;==&quot;6&quot; goto :reducewindows
if &quot;%optwkpc%&quot;==&quot;7&quot; goto :highprioritygame
if &quot;%optwkpc%&quot;==&quot;8&quot; goto :svchostprocess
if &quot;%optwkpc%&quot;==&quot;9&quot; goto :disablegamedvr
if &quot;%optwkpc%&quot;==&quot;10&quot; goto :start
if &quot;%optwkpc%&quot;==&quot;&quot; goto :Start

:servicemanual
cls

echo.
echo Setting services to manual...
sc config &quot;AJRouter&quot; start= demand 2&gt;nul
sc config &quot;ALG&quot; start= demand 2&gt;nul
sc config &quot;AppIDSvc&quot; start= demand 2&gt;nul
sc config &quot;AppMgmt&quot; start= demand 2&gt;nul
sc config &quot;AppReadiness&quot; start= demand 2&gt;nul
sc config &quot;AppXSvc&quot; start= demand 2&gt;nul
sc config &quot;Appinfo&quot; start= demand 2&gt;nul
sc config &quot;AssignedAccessManagerSvc&quot; start= demand 2&gt;nul
sc config &quot;AxInstSV&quot; start= demand 2&gt;nul
sc config &quot;BDESVC&quot; start= demand 2&gt;nul
sc config &quot;BTAGService&quot; start= demand 2&gt;nul
sc config &quot;BcastDVRUserService_*&quot; start= demand 2&gt;nul
sc config &quot;BluetoothUserService_*&quot; start= demand 2&gt;nul
sc config &quot;Browser&quot; start= demand 2&gt;nul
sc config &quot;CaptureService_*&quot; start= demand 2&gt;nul
sc config &quot;CertPropSvc&quot; start= demand 2&gt;nul
sc config &quot;ClipSVC&quot; start= demand 2&gt;nul
sc config &quot;ConsentUxUserSvc_*&quot; start= demand 2&gt;nul
sc config &quot;CredentialEnrollmentManagerUserSvc_*&quot; start= demand 2&gt;nul
sc config &quot;CscService&quot; start= demand 2&gt;nul
sc config &quot;DcpSvc&quot; start= demand 2&gt;nul
sc config &quot;DevQueryBroker&quot; start= demand 2&gt;nul
sc config &quot;DeviceAssociationBrokerSvc_*&quot; start= demand 2&gt;nul
sc config &quot;DeviceAssociationService&quot; start= demand 2&gt;nul
sc config &quot;DeviceInstall&quot; start= demand 2&gt;nul
sc config &quot;DevicePickerUserSvc_*&quot; start= demand 2&gt;nul
sc config &quot;DevicesFlowUserSvc_*&quot; start= demand 2&gt;nul
sc config &quot;DisplayEnhancementService&quot; start= demand 2&gt;nul
sc config &quot;DmEnrollmentSvc&quot; start= demand 2&gt;nul
sc config &quot;DsSvc&quot; start= demand 2&gt;nul
sc config &quot;DsmSvc&quot; start= demand 2&gt;nul
sc config &quot;EFS&quot; start= demand 2&gt;nul
sc config &quot;EapHost&quot; start= demand 2&gt;nul
sc config &quot;EntAppSvc&quot; start= demand 2&gt;nul
sc config &quot;FDResPub&quot; start= demand 2&gt;nul
sc config &quot;Fax&quot; start= demand 2&gt;nul
sc config &quot;FrameServer&quot; start= demand 2&gt;nul
sc config &quot;FrameServerMonitor&quot; start= demand 2&gt;nul
sc config &quot;GraphicsPerfSvc&quot; start= demand 2&gt;nul
sc config &quot;HomeGroupListener&quot; start= demand 2&gt;nul
sc config &quot;HomeGroupProvider&quot; start= demand 2&gt;nul
sc config &quot;HvHost&quot; start= demand 2&gt;nul
sc config &quot;IEEtwCollectorService&quot; start= demand 2&gt;nul
sc config &quot;IKEEXT&quot; start= demand 2&gt;nul
sc config &quot;InstallService&quot; start= demand 2&gt;nul
sc config &quot;InventorySvc&quot; start= demand 2&gt;nul
sc config &quot;IpxlatCfgSvc&quot; start= demand 2&gt;nul
sc config &quot;KtmRm&quot; start= demand 2&gt;nul
sc config &quot;LicenseManager&quot; start= demand 2&gt;nul
sc config &quot;LxpSvc&quot; start= demand 2&gt;nul
sc config &quot;MSDTC&quot; start= demand 2&gt;nul
sc config &quot;MSiSCSI&quot; start= demand 2&gt;nul
sc config &quot;McpManagementService&quot; start= demand 2&gt;nul
sc config &quot;MessagingService_*&quot; start= demand 2&gt;nul
sc config &quot;MicrosoftEdgeElevationService&quot; start= demand 2&gt;nul
sc config &quot;MixedRealityOpenXRSvc&quot; start= demand 2&gt;nul
sc config &quot;NPSMSvc_*&quot; start= demand 2&gt;nul
sc config &quot;NaturalAuthentication&quot; start= demand 2&gt;nul
sc config &quot;NcaSvc&quot; start= demand 2&gt;nul
sc config &quot;NcbService&quot; start= demand 2&gt;nul
sc config &quot;NcdAutoSetup&quot; start= demand 2&gt;nul
sc config &quot;NetSetupSvc&quot; start= demand 2&gt;nul
sc config &quot;Netman&quot; start= demand 2&gt;nul
sc config &quot;NgcCtnrSvc&quot; start= demand 2&gt;nul
sc config &quot;NgcSvc&quot; start= demand 2&gt;nul
sc config &quot;NlaSvc&quot; start= demand 2&gt;nul
sc config &quot;P9RdrService_*&quot; start= demand 2&gt;nul
sc config &quot;PNRPAutoReg&quot; start= demand 2&gt;nul
sc config &quot;PNRPsvc&quot; start= demand 2&gt;nul
sc config &quot;PeerDistSvc&quot; start= demand 2&gt;nul
sc config &quot;PenService_*&quot; start= demand 2&gt;nul
sc config &quot;PerfHost&quot; start= demand 2&gt;nul
sc config &quot;PhoneSvc&quot; start= demand 2&gt;nul
sc config &quot;PimIndexMaintenanceSvc_*&quot; start= demand 2&gt;nul
sc config &quot;PlugPlay&quot; start= demand 2&gt;nul
sc config &quot;PolicyAgent&quot; start= demand 2&gt;nul
sc config &quot;PrintNotify&quot; start= demand 2&gt;nul
sc config &quot;PrintWorkflowUserSvc_*&quot; start= demand 2&gt;nul
sc config &quot;PushToInstall&quot; start= demand 2&gt;nul
sc config &quot;QWAVE&quot; start= demand 2&gt;nul
sc config &quot;RasAuto&quot; start= demand 2&gt;nul
sc config &quot;RasMan&quot; start= demand 2&gt;nul
sc config &quot;RetailDemo&quot; start= demand 2&gt;nul
sc config &quot;RmSvc&quot; start= demand 2&gt;nul
sc config &quot;RpcLocator&quot; start= demand 2&gt;nul
sc config &quot;SCPolicySvc&quot; start= demand 2&gt;nul
sc config &quot;SCardSvr&quot; start= demand 2&gt;nul
sc config &quot;SDRSVC&quot; start= demand 2&gt;nul
sc config &quot;SEMgrSvc&quot; start= demand 2&gt;nul
sc config &quot;SNMPTRAP&quot; start= demand 2&gt;nul
sc config &quot;SNMPTrap&quot; start= demand 2&gt;nul
sc config &quot;SSDPSRV&quot; start= demand 2&gt;nul
sc config &quot;ScDeviceEnum&quot; start= demand 2&gt;nul
sc config &quot;SecurityHealthService&quot; start= demand 2&gt;nul
sc config &quot;Sense&quot; start= demand 2&gt;nul
sc config &quot;SensorDataService&quot; start= demand 2&gt;nul
sc config &quot;SensorService&quot; start= demand 2&gt;nul
sc config &quot;SensrSvc&quot; start= demand 2&gt;nul
sc config &quot;SessionEnv&quot; start= demand 2&gt;nul
sc config &quot;SharedAccess&quot; start= demand 2&gt;nul
sc config &quot;SharedRealitySvc&quot; start= demand 2&gt;nul
sc config &quot;SmsRouter&quot; start= demand 2&gt;nul
sc config &quot;SstpSvc&quot; start= demand 2&gt;nul
sc config &quot;StiSvc&quot; start= demand 2&gt;nul
sc config &quot;TabletInputService&quot; start= demand 2&gt;nul
sc config &quot;TapiSrv&quot; start= demand 2&gt;nul
sc config &quot;TieringEngineService&quot; start= demand 2&gt;nul
sc config &quot;TimeBroker&quot; start= demand 2&gt;nul
sc config &quot;TimeBrokerSvc&quot; start= demand 2&gt;nul
sc config &quot;TokenBroker&quot; start= demand 2&gt;nul
sc config &quot;TroubleshootingSvc&quot; start= demand 2&gt;nul
sc config &quot;TrustedInstaller&quot; start= demand 2&gt;nul
sc config &quot;UI0Detect&quot; start= demand 2&gt;nul
sc config &quot;UdkUserSvc_*&quot; start= demand 2&gt;nul
sc config &quot;UmRdpService&quot; start= demand 2&gt;nul
sc config &quot;UnistoreSvc_*&quot; start= demand 2&gt;nul
sc config &quot;UserDataSvc_*&quot; start= demand 2&gt;nul
sc config &quot;VSS&quot; start= demand 2&gt;nul
sc config &quot;VacSvc&quot; start= demand 2&gt;nul
sc config &quot;W32Time&quot; start= demand 2&gt;nul
sc config &quot;WEPHOSTSVC&quot; start= demand 2&gt;nul
sc config &quot;WFDSConMgrSvc&quot; start= demand 2&gt;nul
sc config &quot;WMPNetworkSvc&quot; start= demand 2&gt;nul
sc config &quot;WManSvc&quot; start= demand 2&gt;nul
sc config &quot;WPDBusEnum&quot; start= demand 2&gt;nul
sc config &quot;WSService&quot; start= demand 2&gt;nul
sc config &quot;WaaSMedicSvc&quot; start= demand 2&gt;nul
sc config &quot;WalletService&quot; start= demand 2&gt;nul
sc config &quot;WarpJITSvc&quot; start= demand 2&gt;nul
sc config &quot;WbioSrvc&quot; start= demand 2&gt;nul
sc config &quot;WcsPlugInService&quot; start= demand 2&gt;nul
sc config &quot;WdNisSvc&quot; start= demand 2&gt;nul
sc config &quot;WdiServiceHost&quot; start= demand 2&gt;nul
sc config &quot;WdiSystemHost&quot; start= demand 2&gt;nul
sc config &quot;WebClient&quot; start= demand 2&gt;nul
sc config &quot;Wecsvc&quot; start= demand 2&gt;nul
sc config &quot;WerSvc&quot; start= demand 2&gt;nul
sc config &quot;WiaRpc&quot; start= demand 2&gt;nul
sc config &quot;WinHttpAutoProxySvc&quot; start= demand 2&gt;nul
sc config &quot;WinRM&quot; start= demand 2&gt;nul
sc config &quot;WpcMonSvc&quot; start= demand 2&gt;nul
sc config &quot;XblAuthManager&quot; start= demand 2&gt;nul
sc config &quot;XblGameSave&quot; start= demand 2&gt;nul
sc config &quot;XboxGipSvc&quot; start= demand 2&gt;nul
sc config &quot;XboxNetApiSvc&quot; start= demand 2&gt;nul
sc config &quot;autotimesvc&quot; start= demand 2&gt;nul
sc config &quot;bthserv&quot; start= demand 2&gt;nul
sc config &quot;camsvc&quot; start= demand 2&gt;nul
sc config &quot;cloudidsvc&quot; start= demand 2&gt;nul
sc config &quot;dcsvc&quot; start= demand 2&gt;nul
sc config &quot;defragsvc&quot; start= demand 2&gt;nul
sc config &quot;diagnosticshub.standardcollector.service&quot; start= demand 2&gt;nul
sc config &quot;diagsvc&quot; start= demand 2&gt;nul
sc config &quot;dmwappushservice&quot; start= demand 2&gt;nul
sc config &quot;dot3svc&quot; start= demand 2&gt;nul
sc config &quot;edgeupdate&quot; start= demand 2&gt;nul
sc config &quot;edgeupdatem&quot; start= demand 2&gt;nul
sc config &quot;embeddedmode&quot; start= demand 2&gt;nul
sc config &quot;fdPHost&quot; start= demand 2&gt;nul
sc config &quot;fhsvc&quot; start= demand 2&gt;nul
sc config &quot;hidserv&quot; start= demand 2&gt;nul
sc config &quot;icssvc&quot; start= demand 2&gt;nul
sc config &quot;lfsvc&quot; start= demand 2&gt;nul
sc config &quot;lltdsvc&quot; start= demand 2&gt;nul
sc config &quot;lmhosts&quot; start= demand 2&gt;nul
sc config &quot;msiserver&quot; start= demand 2&gt;nul
sc config &quot;netprofm&quot; start= demand 2&gt;nul
sc config &quot;p2pimsvc&quot; start= demand 2&gt;nul
sc config &quot;p2psvc&quot; start= demand 2&gt;nul
sc config &quot;perceptionsimulation&quot; start= demand 2&gt;nul
sc config &quot;pla&quot; start= demand 2&gt;nul
sc config &quot;seclogon&quot; start= demand 2&gt;nul
sc config &quot;smphost&quot; start= demand 2&gt;nul
sc config &quot;spectrum&quot; start= demand 2&gt;nul
sc config &quot;svsvc&quot; start= demand 2&gt;nul
sc config &quot;swprv&quot; start= demand 2&gt;nul
sc config &quot;upnphost&quot; start= demand 2&gt;nul
sc config &quot;vds&quot; start= demand 2&gt;nul
sc config &quot;vmicguestinterface&quot; start= demand 2&gt;nul
sc config &quot;vmicheartbeat&quot; start= demand 2&gt;nul
sc config &quot;vmickvpexchange&quot; start= demand 2&gt;nul
sc config &quot;vmicrdv&quot; start= demand 2&gt;nul
sc config &quot;vmicshutdown&quot; start= demand 2&gt;nul
sc config &quot;vmictimesync&quot; start= demand 2&gt;nul
sc config &quot;vmicvmsession&quot; start= demand 2&gt;nul
sc config &quot;vmicvss&quot; start= demand 2&gt;nul
sc config &quot;vmvss&quot; start= demand 2&gt;nul
sc config &quot;wbengine&quot; start= demand 2&gt;nul
sc config &quot;wcncsvc&quot; start= demand 2&gt;nul
sc config &quot;webthreatdefsvc&quot; start= demand 2&gt;nul
sc config &quot;wercplsupport&quot; start= demand 2&gt;nul
sc config &quot;wisvc&quot; start= demand 2&gt;nul
sc config &quot;wlidsvc&quot; start= demand 2&gt;nul
sc config &quot;wlpasvc&quot; start= demand 2&gt;nul
sc config &quot;wmiApSrv&quot; start= demand 2&gt;nul
sc config &quot;workfolderssvc&quot; start= demand 2&gt;nul
sc config &quot;wuauserv&quot; start= demand 2&gt;nul
sc config &quot;wudfsvc&quot; start= demand 2&gt;nul

timeout /t 3 /nobreak
goto :done

:disablefullscreenoptimizations
cls

echo.
echo Disabling Fullscreen Optimizations...

reg add &quot;HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\GameDVR&quot; /v GameDVR_DXGIHonorFSEWindowsCompatible /t REG_DWORD /d 1 /f 2&gt;nul

timeout /t 3 /nobreak
goto :done

:disabletelemetry
cls

echo.
echo Disabling Telemetry Registry...
reg add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection&quot; /v AllowTelemetry /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection&quot; /v AllowTelemetry /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKCU\SOFTWARE\Microsoft\Siuf\Rules&quot; /v NumberOfSIUFInPeriod /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection&quot; /v DoNotShowFeedbackNotifications /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKCU\SOFTWARE\Policies\Microsoft\Windows\CloudContent&quot; /v DisableTailoredExperiencesWithDiagnosticData /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo&quot; /v DisabledByGroupPolicy /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting&quot; /v Disabled /t REG_DWORD /d 1 /f 2&gt;nul

timeout /t 3 /nobreak
goto :done

:disableservices
cls

echo.
echo === Disabling Services ===
sc config &quot;DiagTrack&quot; start= disabled 2&gt;nul
sc config &quot;DPS&quot; start= disabled 2&gt;nul
sc config &quot;FontCache&quot; start= disabled 2&gt;nul
sc config &quot;FontCache3.0.0.0&quot; start= disabled 2&gt;nul
sc config &quot;SystemUsageReportSvc_QUEENCREEK&quot; start= disabled 2&gt;nul
sc config &quot;GpuEnergyDrv&quot; start= disabled 2&gt;nul
sc config &quot;ShellHWDetection&quot; start= disabled 2&gt;nul
sc config &quot;SgrmAgent&quot; start= disabled 2&gt;nul
sc config &quot;SgrmBroker&quot; start= disabled 2&gt;nul
sc config &quot;uhssvc&quot; start= disabled 2&gt;nul
sc config &quot;WdiServiceHost&quot; start= disabled 2&gt;nul
sc config &quot;WdiSystemHost&quot; start= disabled 2&gt;nul
sc config &quot;WSearch&quot; start= disabled 2&gt;nul
sc config &quot;diagsvc&quot; start= disabled 2&gt;nul

timeout /t 3 /nobreak
goto :done

:disablebackgroundapps
cls

echo Disabling background applications
reg add &quot;HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI&quot; /v GlobalUserDisabled /t REG_DWORD /d 1 /f 2&gt;nul

timeout /t 3 /nobreak
goto :done

:reducewindows
cls

echo.
reg add &quot;HKCU\Control Panel\Desktop&quot; /v DragFullWindows /t REG_SZ /d 0 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v MenuShowDelay /t REG_SZ /d 200 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v KeyboardDelay /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v ListviewAlphaSelect /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v ListviewShadow /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v TaskbarAnimations /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v VisualFXSetting /t REG_DWORD /d 3 /f 2&gt;nul
reg add &quot;HKCU\Control Panel\Desktop&quot; /v EnableAeroPeek /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3&quot; /v TaskbarMn /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3&quot; /v TaskbarDa /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced&quot; /v ShowTaskViewButton /t REG_DWORD /d 0 /f 2&gt;nul
reg add &quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced&quot; /v SearchboxTaskbarMode /t REG_DWORD /d 0 /f 2&gt;nul

timeout /t 3 /nobreak
goto :done


:highprioritygame
cls

echo.
echo Setting high priority for games...
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\csgo.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 6 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\cs2.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 6 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FortniteClient-Win64-Shipping.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 6 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\gta_3.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 6 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\gta_vc.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 6 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\gta_sa.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 6 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\GTAIV.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 6 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\GTA5.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 6 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\java.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 6 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\javaw.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 6 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\minecraft.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 6 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Minecraft.Windows.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 6 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\MsMpEng.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 1 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\obs32.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 6 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\obs64.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 6 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\PPSSPP.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 6 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ShellExperienceHost.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 5 /f 2&gt;nul
reg add &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\svchost.exe\PerfOptions&quot; /v CpuPriorityClass /t REG_DWORD /d 5 /f 2&gt;nul
goto :done

:svchostprocess
cls

echo Reducing svchost processes...
for /f &quot;tokens=2 delims==&quot; %%i in (&apos;wmic os get TotalVisibleMemorySize /format:value&apos;) do set MEM=%%i
set /a RAM=%MEM% + 1024000
reg add &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control&quot; /v &quot;SvcHostSplitThresholdInKB&quot; /t REG_DWORD /d &quot;%RAM%&quot; /f 2&gt;nul

timeout /t 3 /nobreak
goto :done

:disablegamedvr
cls

reg add &quot;HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\GameDVR&quot; /v GameDVR_DXGIHonorFSEWindowsCompatible /t REG_DWORD /d 1 /f 2&gt;nul

timeout /t 3 /nobreak
goto :done

:update
cls

echo --------------------------------------------------
echo                   Optimizer
echo --------------------------------------------------
echo.

:: Options to select
echo *1.- Disable Windows Update
echo *2.- Enable Windows Update
echo *3.- Go Back.
echo.

:: Code to go to menu with Options
set /p oput=Option: 
if &quot;%oput%&quot;==&quot;1&quot; goto :WA
if &quot;%oput%&quot;==&quot;2&quot; goto :WD
if &quot;%oput%&quot;==&quot;3&quot; goto :Start
if &quot;%oput%&quot;==&quot;&quot; goto :Start


:WA
cls

:: Disable update related services
for %%i in (wuauserv, UsoSvc, uhssvc, WaaSMedicSvc) do (
	net stop %%i
sc config %%i start= disabled 2&gt;nul
	sc failure %%i reset= 0 actions= &quot;&quot;
)

:: Brute force rename services
for %%i in (WaaSMedicSvc, wuaueng) do (
	takeown /f C:\Windows\System32\%%i.dll &amp;&amp; icacls C:\Windows\System32\%%i.dll /grant *S-1-1-0:F
	rename C:\Windows\System32\%%i.dll %%i_BAK.dll
	icacls C:\Windows\System32\%%i_BAK.dll /setowner &quot;NT SERVICE\TrustedInstaller&quot; &amp;&amp; icacls C:\Windows\System32\%%i_BAK.dll /remove *S-1-1-0
)

:: Update registry
reg add &quot;HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc&quot; /v Start /t REG_DWORD /d 4 /f 2&gt;nul
reg add &quot;HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc&quot; /v FailureActions /t REG_BINARY /d 000000000000000000000000030000001400000000000000c0d4010000000000e09304000000000000000000 /f 2&gt;nul
reg add &quot;HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU&quot; /v NoAutoUpdate /t REG_DWORD /d 1 /f 2&gt;nul

:: Delete downloaded update files
erase /f /s /q c:\windows\softwaredistribution\*.* &amp;&amp; rmdir /s /q c:\windows\softwaredistribution

:: Disable all update related scheduled tasks
schtasks /change /tn &quot;\Microsoft\Windows\InstallService\*&quot; /disable 2&gt;nul
schtasks /change /tn &quot;\Microsoft\Windows\UpdateOrchestrator\*&quot; /disable 2&gt;nul
schtasks /change /tn &quot;\Microsoft\Windows\UpdateAssistant\*&quot; /disable 2&gt;nul
schtasks /change /tn &quot;\Microsoft\Windows\WaaSMedic\*&quot; /disable 2&gt;nul
schtasks /change /tn &quot;\Microsoft\Windows\WindowsUpdate\*&quot; /disable 2&gt;nul
schtasks /change /tn &quot;\Microsoft\WindowsUpdate\*&quot; /disable 2&gt;nul

:: Go Back
timeout /t 3 /nobreak
goto :update  

:WD
cls
:: Enable update related services
sc config wuauserv start= auto 2&gt;nul
sc config UsoSvc start= auto 2&gt;nul
sc config uhssvc start= delayed-auto 2&gt;nul

:: Restore renamed services
for %%i in (WaaSMedicSvc, wuaueng) do (
	takeown /f C:\Windows\System32\%%i_BAK.dll &amp;&amp; icacls C:\Windows\System32\%%i_BAK.dll /grant *S-1-1-0:F
	rename C:\Windows\System32\%%i_BAK.dll %%i.dll
	icacls C:\Windows\System32\%%i.dll /setowner &quot;NT SERVICE\TrustedInstaller&quot; &amp;&amp; icacls C:\Windows\System32\%%i.dll /remove *S-1-1-0
)

:: Update registry
reg add &quot;HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc&quot; /v Start /t REG_DWORD /d 3 /f 2&gt;nul
reg add &quot;HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc&quot; /v FailureActions /t REG_BINARY /d 840300000000000000000000030000001400000001000000c0d4010001000000e09304000000000000000000 /f 2&gt;nul
reg delete &quot;HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU&quot; /v &quot;NoAutoUpdate&quot; /f

:: Enable all update related scheduled tasks
schtasks /change /tn &quot;\Microsoft\Windows\InstallService\*&quot; /enable 2&gt;nul
schtasks /change /tn &quot;\Microsoft\Windows\UpdateOrchestrator\*&quot; /enable 2&gt;nul
schtasks /change /tn &quot;\Microsoft\Windows\UpdateAssistant\*&quot; /enable 2&gt;nul
schtasks /change /tn &quot;\Microsoft\Windows\WaaSMedic\*&quot; /enable 2&gt;nul
schtasks /change /tn &quot;\Microsoft\Windows\WindowsUpdate\*&quot; /enable 2&gt;nul
schtasks /change /tn &quot;\Microsoft\WindowsUpdate\*&quot; /enable 2&gt;nul

:: Go Back
timeout /t 3 /nobreak
goto :update

:about
cls

echo ---------------------------------------------------------------------------------
echo                                 Optimizer
echo ---------------------------------------------------------------------------------
echo.
echo A simple and efficient PC optimizer to increase performance on low-end systems.
echo Special credits to Farhan for the optimizations.
echo.
echo ---------------------------------------------------------------------------------
echo.

:: Code to go to menu with Options
pause
goto :start

:done
cls
echo --------------------------------------------------
echo            Optimization completed!
echo --------------------------------------------------
echo.
echo Your operating system was optimized correctly!	  
echo Please restart your PC to notice the change.
echo.
echo --------------------------------------------------
timeout /t 3 /nobreak
exit /b


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Appearance\Dark Theme.reg">
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize]
&quot;AppsUseLightTheme&quot;=dword:00000000
&quot;SystemUsesLightTheme&quot;=dword:00000000


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Appearance\Disable Action Center.reg">
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Explorer]
&quot;DisableNotificationCenter&quot;=dword:00000001


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Appearance\Disable Cortana.reg">
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search]
&quot;AllowCortana&quot;=dword:00000000
&quot;DisableWebSearch&quot;=dword:00000001
    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Appearance\Disable Transparency.reg">
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize]
&quot;EnableTransparency&quot;=dword:00000000
    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Apps\Apply_Debloat_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Debloat Profile (Tweaks/Apps/Apply_Debloat_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY WINDOWS DEBLOAT PROFILE&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile removes sponsored bloatware (TikTok, Candy Crush)&quot;
Write-Host &quot;and unnecessary default Microsoft apps (3D Viewer, Feedback Hub).&quot;
Write-Host &quot;This cleans up the Start Menu and reclaims disk space.&quot;
Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Apps&quot; -Action &quot;Aborted Debloat Profile Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Apps&quot; -Action &quot;Starting Master Debloat Orchestrator&quot; -Level WARNING

$ScriptDir = $PSScriptRoot

Write-Host &quot;`n[1/2] Removing Sponsored Bloatware...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Remove_Sponsored_Apps.ps1&quot;) -Force:$Force

Write-Host &quot;`n[2/2] Removing Unnecessary Microsoft Apps...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Remove_Unnecessary_MS_Apps.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Apps&quot; -Action &quot;Completed Master Debloat Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Debloat Profile deployment complete!&quot; -ForegroundColor Green
if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Apps\Remove_Sponsored_Apps.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Remove Sponsored Apps (Tweaks/Apps/Remove_Sponsored_Apps.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Apps&quot; -Action &quot;Initiating Sponsored Apps Removal&quot;

# Array of known sponsored apps/bloatware
$SponsoredApps = @(
    &quot;*TikTok*&quot;,
    &quot;*Instagram*&quot;,
    &quot;*Facebook*&quot;,
    &quot;*Twitter*&quot;,
    &quot;*Netflix*&quot;,
    &quot;*Spotify*&quot;,
    &quot;*Disney*&quot;,
    &quot;*CandyCrush*&quot;,
    &quot;*Solitaire*&quot;,
    &quot;*MinecraftUWP*&quot;,
    &quot;*Roblox*&quot;,
    &quot;*HiddenCity*&quot;,
    &quot;*MarchofEmpires*&quot;,
    &quot;*BubbleWitch3Saga*&quot;,
    &quot;*Asphalt8*&quot;,
    &quot;*BingNews*&quot;
)

$RemovedCount = 0

foreach ($App in $SponsoredApps) {
    # Remove for current user
    $Packages = Get-AppxPackage -Name $App -ErrorAction SilentlyContinue
    
    if ($Packages) {
        foreach ($Pkg in $Packages) {
            Remove-AppxPackage -Package $Pkg.PackageFullName -ErrorAction SilentlyContinue
            Write-FrameworkLog -ModuleName &quot;Apps&quot; -Action &quot;Removed Sponsored App&quot; -OldValue $Pkg.Name -NewValue &quot;Removed&quot;
            $RemovedCount++
        }
    }
    
    # Remove from provisioned packages (so it doesn&apos;t reinstall for new users)
    $Provisioned = Get-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -like $App }
    if ($Provisioned) {
        foreach ($Prov in $Provisioned) {
            Remove-AppxProvisionedPackage -Online -PackageName $Prov.PackageName -ErrorAction SilentlyContinue | Out-Null
            Write-FrameworkLog -ModuleName &quot;Apps&quot; -Action &quot;Deprovisioned Sponsored App&quot; -OldValue $Prov.DisplayName -NewValue &quot;Removed&quot;
        }
    }
}

Write-Host &quot;`n[SUCCESS] Successfully removed $RemovedCount sponsored apps.&quot; -ForegroundColor Green
Write-Host &quot;Third-party bloatware like Candy Crush and TikTok have been scrubbed from the system.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Apps\Remove_Unnecessary_MS_Apps.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Remove Unnecessary MS Apps (Tweaks/Apps/Remove_Unnecessary_MS_Apps.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Apps&quot; -Action &quot;Initiating Unnecessary MS Apps Removal&quot;

# Array of Microsoft apps that are generally safe to remove and often considered bloatware
$MSApps = @(
    &quot;*Microsoft3DViewer*&quot;,
    &quot;*WindowsFeedbackHub*&quot;,
    &quot;*GetHelp*&quot;,
    &quot;*MixedReality.Portal*&quot;,
    &quot;*ZuneVideo*&quot;, # Movies &amp; TV
    &quot;*ZuneMusic*&quot;, # Groove Music (legacy)
    &quot;*WindowsMaps*&quot;,
    &quot;*Office.OneNote*&quot;,
    &quot;*People*&quot;,
    &quot;*YourPhone*&quot;, # Phone Link
    &quot;*WindowsAlarms*&quot;,
    &quot;*WindowsCamera*&quot;,
    &quot;*Microsoft.Getstarted*&quot;, # Tips
    &quot;*SkypeApp*&quot;,
    &quot;*BingWeather*&quot;
)

$RemovedCount = 0

foreach ($App in $MSApps) {
    # Remove for current user
    $Packages = Get-AppxPackage -Name $App -ErrorAction SilentlyContinue
    
    if ($Packages) {
        foreach ($Pkg in $Packages) {
            Remove-AppxPackage -Package $Pkg.PackageFullName -ErrorAction SilentlyContinue
            Write-FrameworkLog -ModuleName &quot;Apps&quot; -Action &quot;Removed MS App&quot; -OldValue $Pkg.Name -NewValue &quot;Removed&quot;
            $RemovedCount++
        }
    }
    
    # Remove from provisioned packages (so it doesn&apos;t reinstall for new users)
    $Provisioned = Get-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -like $App }
    if ($Provisioned) {
        foreach ($Prov in $Provisioned) {
            Remove-AppxProvisionedPackage -Online -PackageName $Prov.PackageName -ErrorAction SilentlyContinue | Out-Null
            Write-FrameworkLog -ModuleName &quot;Apps&quot; -Action &quot;Deprovisioned MS App&quot; -OldValue $Prov.DisplayName -NewValue &quot;Removed&quot;
        }
    }
}

Write-Host &quot;`n[SUCCESS] Successfully removed $RemovedCount unnecessary Microsoft apps.&quot; -ForegroundColor Green
Write-Host &quot;Unused default apps like 3D Viewer and Feedback Hub have been uninstalled.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Audio\Disable_Audio_Enhancements.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Audio Enhancements (Tweaks/Audio/Disable_Audio_Enhancements.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force
$SnapshotDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Restore\Audio&quot;

if (-not (Test-Path $SnapshotDir)) { New-Item -Path $SnapshotDir -ItemType Directory -Force | Out-Null }

Write-Host &quot;=================================================&quot;
Write-Host &quot;   AUDIO ENHANCEMENTS MANAGER (LATENCY FIX)&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;Windows and Audio Drivers (like Realtek) often inject &apos;Signal&quot;
Write-Host &quot;Enhancements&apos; (APOs) that add artificial latency and color the&quot;
Write-Host &quot;sound. Disabling these is critical for pure audio delivery.&quot;
Write-Host &quot;=================================================&quot;
Write-Host &quot;1. Disable All Audio Enhancements (Recommended for Latency/Purity)&quot;
Write-Host &quot;2. Enable Audio Enhancements (Default)&quot;
Write-Host &quot;3. Abort&quot;
Write-Host &quot;=================================================&quot;
$Choice = Read-Host &quot;Select an option [1-3]&quot;

if ($Choice -notmatch &apos;^[1-2]$&apos;) {
    Write-FrameworkLog -ModuleName &quot;Audio&quot; -Action &quot;Aborted Audio Enhancements config&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-Host &quot;`nScanning for Audio Endpoints...&quot; -ForegroundColor Yellow
$RenderPath = &quot;HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render&quot;
$CapturePath = &quot;HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Capture&quot;

# Function to toggle DisableProtectedAudioDG and DisableSysFx
function Toggle-Enhancements {
    param([string]$KeyPath, [int]$Value)
    
    if (Test-Path $KeyPath) {
        $Devices = Get-ChildItem -Path $KeyPath
        foreach ($Device in $Devices) {
            $FxProperties = Join-Path -Path $Device.PSPath -ChildPath &quot;FxProperties&quot;
            if (Test-Path $FxProperties) {
                # Backup the specific FX key if disabling
                if ($Value -eq 1) {
                    $BackupFile = Join-Path -Path $SnapshotDir -ChildPath &quot;AudioFX_$($Device.PSChildName)_$(Get-Date -Format &apos;yyyyMMdd_HHmmss&apos;).reg&quot;
                    $RegPathClean = $FxProperties -replace &quot;::&quot;, &quot;&quot; -replace &quot;Microsoft.PowerShell.Core\\Registry::&quot;, &quot;&quot;
                    &amp; reg export $RegPathClean $BackupFile /y 2&gt;$null | Out-Null
                }

                # Set DisableSysFx (commonly {1da5d803-d492-4edd-8c23-e0c0ffee7f0e},5)
                # Just loop through known property keys that disable effects
                $Props = Get-Item -Path $FxProperties
                foreach ($PropName in $Props.Property) {
                    if ($PropName -match &quot;1da5d803-d492-4edd-8c23-e0c0ffee7f0e&quot;) {
                        Set-ItemProperty -Path $FxProperties -Name $PropName -Value $Value -Type DWord -Force -ErrorAction SilentlyContinue
                    }
                }
            }
        }
    }
}

if ($Choice -eq &apos;1&apos;) {
    Write-Host &quot;Disabling enhancements on Output devices...&quot; -ForegroundColor Yellow
    Toggle-Enhancements -KeyPath $RenderPath -Value 1
    Write-Host &quot;Disabling enhancements on Input devices...&quot; -ForegroundColor Yellow
    Toggle-Enhancements -KeyPath $CapturePath -Value 1
    
    Write-FrameworkLog -ModuleName &quot;Audio&quot; -Action &quot;Disabled Audio Enhancements globally&quot;
    Write-Host &quot;`n[SUCCESS] Audio Enhancements are DISABLED.&quot; -ForegroundColor Green
} else {
    Write-Host &quot;Enabling enhancements on Output devices...&quot; -ForegroundColor Yellow
    Toggle-Enhancements -KeyPath $RenderPath -Value 0
    Write-Host &quot;Enabling enhancements on Input devices...&quot; -ForegroundColor Yellow
    Toggle-Enhancements -KeyPath $CapturePath -Value 0

    Write-FrameworkLog -ModuleName &quot;Audio&quot; -Action &quot;Enabled Audio Enhancements globally&quot;
    Write-Host &quot;`n[SUCCESS] Audio Enhancements are ENABLED.&quot; -ForegroundColor Green
}

Write-Host &quot;Please restart the Windows Audio service or reboot to apply changes.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Audio\Exclusive_Mode_Manager.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Exclusive Mode Manager (Tweaks/Audio/Exclusive_Mode_Manager.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force
$SnapshotDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Restore\Audio&quot;

if (-not (Test-Path $SnapshotDir)) { New-Item -Path $SnapshotDir -ItemType Directory -Force | Out-Null }

Write-Host &quot;=================================================&quot;
Write-Host &quot;   WASAPI EXCLUSIVE MODE MANAGER&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;WASAPI Exclusive Mode allows applications (games, DAWs)&quot;
Write-Host &quot;to bypass the Windows audio mixer, communicating directly&quot;
Write-Host &quot;with the audio driver for the lowest possible latency.&quot;
Write-Host &quot;=================================================&quot;
Write-Host &quot;1. Enable Exclusive Mode (Recommended for Gamers/Producers)&quot;
Write-Host &quot;2. Disable Exclusive Mode (Forces all audio through Windows Mixer)&quot;
Write-Host &quot;3. Abort&quot;
Write-Host &quot;=================================================&quot;
$Choice = Read-Host &quot;Select an option [1-3]&quot;

if ($Choice -notmatch &apos;^[1-2]$&apos;) {
    Write-FrameworkLog -ModuleName &quot;Audio&quot; -Action &quot;Aborted Exclusive Mode config&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-Host &quot;`nScanning for Audio Endpoints...&quot; -ForegroundColor Yellow
$RenderPath = &quot;HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render&quot;
$CapturePath = &quot;HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Capture&quot;

function Toggle-ExclusiveMode {
    param([string]$KeyPath, [int]$Value)
    
    if (Test-Path $KeyPath) {
        $Devices = Get-ChildItem -Path $KeyPath
        foreach ($Device in $Devices) {
            $Properties = Join-Path -Path $Device.PSPath -ChildPath &quot;Properties&quot;
            if (Test-Path $Properties) {
                # Property {b3f8fa53-0004-438e-9003-51a46e139bfc},3 corresponds to &quot;Allow applications to take exclusive control of this device&quot;
                # Property {b3f8fa53-0004-438e-9003-51a46e139bfc},4 corresponds to &quot;Give exclusive mode applications priority&quot;
                
                Set-ItemProperty -Path $Properties -Name &quot;{b3f8fa53-0004-438e-9003-51a46e139bfc},3&quot; -Value $Value -Type DWord -Force -ErrorAction SilentlyContinue
                Set-ItemProperty -Path $Properties -Name &quot;{b3f8fa53-0004-438e-9003-51a46e139bfc},4&quot; -Value $Value -Type DWord -Force -ErrorAction SilentlyContinue
            }
        }
    }
}

if ($Choice -eq &apos;1&apos;) {
    Write-Host &quot;Enabling Exclusive Mode on Output devices...&quot; -ForegroundColor Yellow
    Toggle-ExclusiveMode -KeyPath $RenderPath -Value 1
    Write-Host &quot;Enabling Exclusive Mode on Input devices...&quot; -ForegroundColor Yellow
    Toggle-ExclusiveMode -KeyPath $CapturePath -Value 1
    
    Write-FrameworkLog -ModuleName &quot;Audio&quot; -Action &quot;Enabled WASAPI Exclusive Mode&quot;
    Write-Host &quot;`n[SUCCESS] Exclusive Mode is ENABLED.&quot; -ForegroundColor Green
} else {
    Write-Host &quot;Disabling Exclusive Mode on Output devices...&quot; -ForegroundColor Yellow
    Toggle-ExclusiveMode -KeyPath $RenderPath -Value 0
    Write-Host &quot;Disabling Exclusive Mode on Input devices...&quot; -ForegroundColor Yellow
    Toggle-ExclusiveMode -KeyPath $CapturePath -Value 0

    Write-FrameworkLog -ModuleName &quot;Audio&quot; -Action &quot;Disabled WASAPI Exclusive Mode&quot;
    Write-Host &quot;`n[SUCCESS] Exclusive Mode is DISABLED.&quot; -ForegroundColor Red
}

Write-Host &quot;Please restart the Windows Audio service or reboot to apply changes.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Background\Interactive_Manage_Background_Apps.ps1">
# ==============================================================================
# SCRIPT: Manage Background Apps
# TARGET SYSTEM: Windows 10 &amp; Windows 11
# DESCRIPTION: Manages Windows background applications behavior. 
#              Provides global disabling/enabling of background app activity
#              as well as granular control for individual Microsoft Store/UWP apps.
# SAFETY LEVEL: Safe &amp; Fully Reversible
# ==============================================================================

$Host.UI.RawUI.WindowTitle = &quot;Windows Background Apps Manager&quot;

$GlobalReg = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications&quot;
$ConsentReg = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\backgroundTasks&quot;

# Ensure global key exists
if (-not (Test-Path $GlobalReg)) {
    New-Item -Path $GlobalReg -Force | Out-Null
}
# Ensure consent key exists
if (-not (Test-Path $ConsentReg)) {
    New-Item -Path $ConsentReg -Force | Out-Null
}

function Clear-Console {
    Clear-Host
    Write-Host &quot;======================================================================&quot; -ForegroundColor Cyan
    Write-Host &quot;                      WINDOWS BACKGROUND APPS MANAGER                 &quot; -ForegroundColor Cyan
    Write-Host &quot;======================================================================&quot; -ForegroundColor Cyan
    Write-Host &quot;&quot;
}

function Check-GlobalStatus {
    $val = Get-ItemProperty -Path $GlobalReg -Name &quot;GlobalUserDisabled&quot; -ErrorAction SilentlyContinue
    if ($val -and $val.GlobalUserDisabled -eq 1) {
        return &quot;DISABLED (All background apps blocked)&quot;
    } else {
        return &quot;ENABLED (Background apps permitted globally)&quot;
    }
}

while ($true) {
    Clear-Console
    $globalStatus = Check-GlobalStatus
    Write-Host &quot;[*] Current Global Background Status: $globalStatus&quot; -ForegroundColor Yellow
    Write-Host &quot;&quot;
    Write-Host &quot;Choose an option:&quot; -ForegroundColor White
    Write-Host &quot;  1. Turn OFF Background Activity Globally (Recommended for max performance)&quot; -ForegroundColor Green
    Write-Host &quot;  2. Turn ON Background Activity Globally (Windows Default)&quot; -ForegroundColor Gray
    Write-Host &quot;  3. Manage Individual App Background Permissions&quot; -ForegroundColor White
    Write-Host &quot;  4. Exit&quot; -ForegroundColor Red
    Write-Host &quot;&quot;
    
    $choice = Read-Host &quot;Option (1-4)&quot;

    switch ($choice) {
        &quot;1&quot; {
            try {
                Set-ItemProperty -Path $GlobalReg -Name &quot;GlobalUserDisabled&quot; -Value 1 -Type DWord -Force | Out-Null
                Write-Host &quot;&quot;
                Write-Host &quot;[+] All background applications have been disabled globally!&quot; -ForegroundColor Green
                Write-Host &quot;    Note: Individual settings will be overridden by this global block.&quot; -ForegroundColor Gray
            } catch {
                Write-Host &quot;[!] Error: Failed to update global registry settings.&quot; -ForegroundColor Red
            }
            Start-Sleep -Seconds 2
        }
        
        &quot;2&quot; {
            try {
                # Set to 0 or remove
                Remove-ItemProperty -Path $GlobalReg -Name &quot;GlobalUserDisabled&quot; -ErrorAction SilentlyContinue
                Write-Host &quot;&quot;
                Write-Host &quot;[+] Background applications re-enabled globally!&quot; -ForegroundColor Green
                Write-Host &quot;    Note: Individual app permissions will now be respected.&quot; -ForegroundColor Gray
            } catch {
                Write-Host &quot;[!] Error: Failed to update global registry settings.&quot; -ForegroundColor Red
            }
            Start-Sleep -Seconds 2
        }

        &quot;3&quot; {
            while ($true) {
                Clear-Console
                Write-Host &quot;Scanning installed Windows Store/UWP packages...&quot; -ForegroundColor Gray
                
                # Fetch packages
                $packages = Get-AppxPackage -User ([System.Security.Principal.WindowsIdentity]::GetCurrent().Name) | 
                            Select-Object Name, PackageFamilyName -Unique | 
                            Sort-Object Name
                
                Write-Host &quot;=== Individual App Background Permissions ===&quot; -ForegroundColor Cyan
                Write-Host &quot;    (Note: Denying background permissions keeps the app from running when closed)&quot; -ForegroundColor Gray
                Write-Host &quot;&quot;

                $index = 1
                $appList = @()
                foreach ($pkg in $packages) {
                    # Skip system-critical packages if they are too basic
                    if ($pkg.Name -like &quot;*Framework*&quot; -or $pkg.Name -like &quot;*Runtime*&quot;) { continue }

                    # Get current individual status from CapabilityAccessManager
                    $appRegPath = &quot;$ConsentReg\$($pkg.PackageFamilyName)&quot;
                    $status = &quot;Allow (Default)&quot;
                    if (Test-Path $appRegPath) {
                        $val = Get-ItemProperty -Path $appRegPath -Name &quot;Value&quot; -ErrorAction SilentlyContinue
                        if ($val) { $status = $val.Value }
                    }

                    $statusColor = &quot;Green&quot;
                    if ($status -eq &quot;Deny&quot;) { $statusColor = &quot;Red&quot; }

                    Write-Host -NoNewline &quot;  [$index] $($pkg.Name) &quot; -ForegroundColor White
                    Write-Host -NoNewline &quot;--&gt; Current State: &quot; -ForegroundColor Gray
                    Write-Host $status -ForegroundColor $statusColor
                    
                    $appList += [PSCustomObject]@{
                        Index = $index
                        Name = $pkg.Name
                        Family = $pkg.PackageFamilyName
                        Status = $status
                    }
                    $index++
                }

                Write-Host &quot;&quot;
                $select = Read-Host &quot;Select app number to toggle Deny/Allow (or &apos;q&apos; to go back)&quot;
                if ($select -eq &quot;q&quot;) { break }

                $match = $appList | Where-Object { $_.Index -eq $select }
                if ($match) {
                    $appRegPath = &quot;$ConsentReg\$($match.Family)&quot;
                    if (-not (Test-Path $appRegPath)) {
                        New-Item -Path $appRegPath -Force | Out-Null
                    }

                    $newVal = &quot;Deny&quot;
                    if ($match.Status -eq &quot;Deny&quot;) {
                        $newVal = &quot;Allow&quot;
                    }

                    try {
                        Set-ItemProperty -Path $appRegPath -Name &quot;Value&quot; -Value $newVal -Type String -Force | Out-Null
                        Write-Host &quot;&quot;
                        Write-Host &quot;[+] Successfully set $($match.Name) background permission to: $newVal&quot; -ForegroundColor Green
                        Start-Sleep -Seconds 1
                    } catch {
                        Write-Host &quot;[!] Error: Failed to modify app settings in registry.&quot; -ForegroundColor Red
                        Start-Sleep -Seconds 2
                    }
                } else {
                    Write-Host &quot;Invalid selection.&quot; -ForegroundColor Red
                    Start-Sleep -Seconds 1
                }
            }
        }
        
        &quot;4&quot; {
            Write-Host &quot;Exiting...&quot; -ForegroundColor Cyan
            break
        }
    }
}

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Boot\Detect_Slow_Startup_Apps.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Detect Slow Startup Apps (Tweaks/Boot/Detect_Slow_Startup_Apps.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

Write-Host &quot;=================================================&quot;
Write-Host &quot;   STARTUP APPLICATION ANALYZER&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;Querying all active startup hooks from the registry...&quot;
Write-Host &quot;=================================================`n&quot;

$Paths = @(
    &quot;HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&quot;,
    &quot;HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run&quot;,
    &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\Run&quot;
)

$StartupApps = @()

foreach ($Path in $Paths) {
    if (Test-Path $Path) {
        $Key = Get-Item -Path $Path
        foreach ($ValueName in $Key.Property) {
            $ValueData = (Get-ItemProperty -Path $Path -Name $ValueName).$ValueName
            $StartupApps += [PSCustomObject]@{
                Name = $ValueName
                Command = $ValueData
                Scope = if ($Path -match &quot;HKLM&quot;) { &quot;System-Wide&quot; } else { &quot;Current User&quot; }
            }
        }
    }
}

if ($StartupApps.Count -eq 0) {
    Write-Host &quot;No traditional startup applications found in Run keys.&quot; -ForegroundColor Green
} else {
    $StartupApps | Format-Table -AutoSize
}

Write-Host &quot;`nWARNING: The following apps are known to severely delay boot times:&quot; -ForegroundColor Yellow
Write-Host &quot;- Adobe Creative Cloud / Acrobat Update Services&quot;
Write-Host &quot;- RGB/Hardware Software (iCUE, Armoury Crate, Razer Synapse)&quot;
Write-Host &quot;- Game Launchers (Steam, Epic, EA) set to start automatically&quot;
Write-Host &quot;- Third-party Antivirus (McAfee, Norton)&quot;

Write-Host &quot;`nRecommendation: Open Task Manager (Ctrl+Shift+Esc), go to the&quot; -ForegroundColor Cyan
Write-Host &quot;&apos;Startup Apps&apos; tab, and disable everything except your critical audio/GPU drivers.&quot;

Write-Host &quot;`nPress any key to exit...&quot;
if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Boot\Generate_Boot_Trace.ps1">
# Windows Configuration &amp; Optimization Framework
# Generate Boot Trace (Tweaks/Boot/Generate_Boot_Trace.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

Write-Host &quot;=================================================&quot;
Write-Host &quot;   ETW BOOT TRACE GENERATOR&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This will configure the Windows Performance Recorder (WPR)&quot;
Write-Host &quot;to capture an Event Tracing for Windows (ETW) log during&quot;
Write-Host &quot;the next system boot. This is the most advanced way to&quot;
Write-Host &quot;diagnose slow boot times and hanging services.&quot;
Write-Host &quot;=================================================&quot;
Write-Host &quot;1. Arm the system for a Boot Trace (Requires Reboot)&quot;
Write-Host &quot;2. Cancel a pending Boot Trace&quot;
Write-Host &quot;3. Abort&quot;
Write-Host &quot;=================================================&quot;
$Choice = Read-Host &quot;Select an option [1-3]&quot;

if ($Choice -notmatch &apos;^[1-2]$&apos;) {
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

if (-not (Get-Command &quot;wpr&quot; -ErrorAction SilentlyContinue)) {
    Write-Host &quot;`n[ERROR] Windows Performance Recorder (wpr.exe) is not available.&quot; -ForegroundColor Red
    Write-Host &quot;It is usually included with Windows 10/11 natively.&quot;
    Exit
}

if ($Choice -eq &apos;1&apos;) {
    Write-Host &quot;`nArming WPR for next boot...&quot; -ForegroundColor Yellow
    # Profiles: CPU, DiskIO, GeneralProfile
    $WprArgs = &quot;-boottrace -addboot CPU -addboot DiskIO -filemode&quot;
    Invoke-Expression &quot;wpr $WprArgs&quot;
    
    Write-Host &quot;`n[SUCCESS] The system is armed.&quot; -ForegroundColor Green
    Write-Host &quot;Please RESTART YOUR COMPUTER.&quot;
    Write-Host &quot;After logging in, WPR will finish saving the trace file&quot;
    Write-Host &quot;to your Documents\WPR Files folder. You can analyze it&quot;
    Write-Host &quot;using Windows Performance Analyzer (WPA).&quot; -ForegroundColor Cyan
} else {
    Write-Host &quot;`nCancelling pending boot trace...&quot; -ForegroundColor Yellow
    Invoke-Expression &quot;wpr -cancel&quot;
    Write-Host &quot;`n[SUCCESS] Any pending boot trace has been cancelled.&quot; -ForegroundColor Green
}



$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Browser\Configure Edge Performance.reg">
Windows Registry Editor Version 5.00

; ==============================================================================
; TWEAK: Configure Microsoft Edge Performance Policies
; TARGET SYSTEM: Windows 10 &amp; Windows 11
; DESCRIPTION: Optimizes Edge memory and background CPU footprint.
;              - Enables Sleeping Tabs to freeze idle tabs after 5 minutes (300 sec).
;              - Disables Startup Boost so Edge doesn&apos;t run background processes 
;                when closed.
; SAFETY LEVEL: Safe &amp; Reversible
; ==============================================================================

; --- Current User Policies ---
[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Edge]
&quot;SleepingTabsEnabled&quot;=dword:00000001
&quot;SleepingTabsTimeout&quot;=dword:0000012c
&quot;StartupBoostEnabled&quot;=dword:00000000

; --- System-wide Policies ---
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge]
&quot;SleepingTabsEnabled&quot;=dword:00000001
&quot;SleepingTabsTimeout&quot;=dword:0000012c
&quot;StartupBoostEnabled&quot;=dword:00000000

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Camera\Apply_Privacy_Camera_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Privacy Camera Profile (Tweaks/Camera/Apply_Privacy_Camera_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY PRIVACY CAMERA PROFILE&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile strictly locks down your camera for privacy and security.&quot;
Write-Host &quot;It disables lock screen camera access and completely blocks Windows&quot;
Write-Host &quot;Apps from using your webcam.&quot;
Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Camera&quot; -Action &quot;Aborted Privacy Camera Profile Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Camera&quot; -Action &quot;Starting Master Privacy Camera Orchestrator&quot; -Level WARNING

$ScriptDir = $PSScriptRoot

Write-Host &quot;`n[1/2] Disabling Lock Screen Camera Access...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_LockScreen_Camera.ps1&quot;) -Force:$Force

Write-Host &quot;`n[2/2] Blocking Global App Camera Access...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_App_Camera_Access.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Camera&quot; -Action &quot;Completed Master Privacy Camera Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Privacy Camera Profile deployment complete!&quot; -ForegroundColor Green
if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Camera\Disable_App_Camera_Access.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable App Camera Access (Tweaks/Camera/Disable_App_Camera_Access.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Camera&quot; -Action &quot;Initiating Global App Camera Access Disablement&quot;

$RegistryPath = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam&quot;
if (-not (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null }
$Name = &quot;Value&quot;

# 1. Snapshot current state
$CurrentValue = (Get-ItemProperty -Path $RegistryPath -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentValue) { $CurrentValue = &quot;Not_Set&quot; }

# 2. Apply Configuration (Deny = Disabled, Allow = Enabled)
Set-ItemProperty -Path $RegistryPath -Name $Name -Value &quot;Deny&quot; -Type String -Force

# 3. Log Outcome
Write-FrameworkLog -ModuleName &quot;Camera&quot; -Action &quot;Disabled Global App Camera Access&quot; -OldValue $CurrentValue -NewValue &quot;Deny&quot;

Write-Host &quot;`n[SUCCESS] Global App access to the Camera has been blocked (Deny).&quot; -ForegroundColor Green
Write-Host &quot;Note: Traditional desktop apps (like OBS) may still access it, but UWP/Store apps are blocked.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Camera\Disable_LockScreen_Camera.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Lock Screen Camera (Tweaks/Camera/Disable_LockScreen_Camera.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Camera&quot; -Action &quot;Initiating Lock Screen Camera Disablement&quot;

$RegistryPath = &quot;HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization&quot;
if (-not (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null }
$Name = &quot;NoLockScreenCamera&quot;

# 1. Snapshot current state
$CurrentValue = (Get-ItemProperty -Path $RegistryPath -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentValue) { $CurrentValue = &quot;Not_Set&quot; }

# 2. Apply Configuration (1 = Disabled, 0 = Enabled)
Set-ItemProperty -Path $RegistryPath -Name $Name -Value 1 -Type DWord -Force

# 3. Log Outcome
Write-FrameworkLog -ModuleName &quot;Camera&quot; -Action &quot;Disabled Lock Screen Camera&quot; -OldValue $CurrentValue -NewValue &quot;1&quot;

Write-Host &quot;`n[SUCCESS] The camera can no longer be activated from the Windows Lock Screen.&quot; -ForegroundColor Green


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Clipboard\Apply_Privacy_Clipboard_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Privacy Clipboard Profile (Tweaks/Clipboard/Apply_Privacy_Clipboard_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY PRIVACY CLIPBOARD PROFILE&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile strictly locks down your clipboard for privacy and security.&quot;
Write-Host &quot;It disables clipboard history (to prevent password snooping in RAM)&quot;
Write-Host &quot;and completely blocks clipboard syncing to the Microsoft Cloud.&quot;
Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Clipboard&quot; -Action &quot;Aborted Privacy Clipboard Profile Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Clipboard&quot; -Action &quot;Starting Master Privacy Clipboard Orchestrator&quot; -Level WARNING

$ScriptDir = $PSScriptRoot

Write-Host &quot;`n[1/2] Disabling Local Clipboard History...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Clipboard_History.ps1&quot;) -Force:$Force

Write-Host &quot;`n[2/2] Disabling Cloud Clipboard Syncing...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Clipboard_Cloud_Sync.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Clipboard&quot; -Action &quot;Completed Master Privacy Clipboard Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Privacy Clipboard Profile deployment complete!&quot; -ForegroundColor Green
if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Clipboard\Disable_Clipboard_Cloud_Sync.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Clipboard Cloud Sync (Tweaks/Clipboard/Disable_Clipboard_Cloud_Sync.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Clipboard&quot; -Action &quot;Initiating Clipboard Cloud Sync Disablement&quot;

$RegistryPath = &quot;HKCU:\Software\Microsoft\Clipboard&quot;
if (-not (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null }
$Name = &quot;CloudClipboardItemSyncEnabled&quot;

# 1. Snapshot current state
$CurrentValue = (Get-ItemProperty -Path $RegistryPath -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentValue) { $CurrentValue = &quot;Not_Set&quot; }

# 2. Apply Configuration (0 = Disabled, 1 = Enabled)
Set-ItemProperty -Path $RegistryPath -Name $Name -Value 0 -Type DWord -Force

# 3. Log Outcome
Write-FrameworkLog -ModuleName &quot;Clipboard&quot; -Action &quot;Disabled Clipboard Cloud Sync&quot; -OldValue $CurrentValue -NewValue &quot;0&quot;

Write-Host &quot;`n[SUCCESS] Windows Clipboard Cloud Sync has been disabled.&quot; -ForegroundColor Green
Write-Host &quot;Your copied text and images will no longer be uploaded to Microsoft servers.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Clipboard\Disable_Clipboard_History.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Clipboard History (Tweaks/Clipboard/Disable_Clipboard_History.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Clipboard&quot; -Action &quot;Initiating Clipboard History Disablement&quot;

$RegistryPath = &quot;HKCU:\Software\Microsoft\Clipboard&quot;
if (-not (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null }
$Name = &quot;EnableClipboardHistory&quot;

# 1. Snapshot current state
$CurrentValue = (Get-ItemProperty -Path $RegistryPath -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentValue) { $CurrentValue = &quot;Not_Set&quot; }

# 2. Apply Configuration (0 = Disabled, 1 = Enabled)
Set-ItemProperty -Path $RegistryPath -Name $Name -Value 0 -Type DWord -Force

# 3. Log Outcome
Write-FrameworkLog -ModuleName &quot;Clipboard&quot; -Action &quot;Disabled Clipboard History&quot; -OldValue $CurrentValue -NewValue &quot;0&quot;

Write-Host &quot;`n[SUCCESS] Windows Clipboard History has been disabled.&quot; -ForegroundColor Green
Write-Host &quot;Passwords and sensitive data will no longer be stored indefinitely in RAM.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Developer\Configure_Developer_Mode.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Configure Developer Mode (Tweaks/Developer/Configure_Developer_Mode.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force
$SnapshotDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Restore&quot;

Write-Host &quot;=================================================&quot;
Write-Host &quot;   CONFIGURE WINDOWS DEVELOPER MODE&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;Developer Mode enables side-loading apps, relaxes&quot;
Write-Host &quot;execution policies for local scripts, and exposes&quot;
Write-Host &quot;advanced file explorer tools.&quot;
Write-Host &quot;Press &apos;Y&apos; to enable Developer Mode or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Developer&quot; -Action &quot;Aborted Developer Mode config&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Developer&quot; -Action &quot;Backing up Developer Mode registry keys&quot;
$RegPath1 = &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock&quot;
$BackupFile = Join-Path -Path $SnapshotDir -ChildPath &quot;DevMode_Backup_$(Get-Date -Format &apos;yyyyMMdd_HHmmss&apos;).reg&quot;
&amp; reg export $RegPath1 $BackupFile /y | Out-Null

Write-Host &quot;`nEnabling Developer Mode...&quot; -ForegroundColor Yellow
$RegPath = &quot;HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock&quot;
if (-not (Test-Path $RegPath)) {
    New-Item -Path $RegPath -Force | Out-Null
}

Set-ItemProperty -Path $RegPath -Name &quot;AllowAllTrustedApps&quot; -Value 1 -Type DWord -Force
Set-ItemProperty -Path $RegPath -Name &quot;AllowDevelopmentWithoutDevLicense&quot; -Value 1 -Type DWord -Force

Write-FrameworkLog -ModuleName &quot;Developer&quot; -Action &quot;Enabled Developer Mode&quot;

Write-Host &quot;`n[SUCCESS] Windows Developer Mode has been enabled.&quot; -ForegroundColor Green


$null = Read-Host &quot;Press Enter to exit...&quot;


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Developer\Configure_WSL.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Configure WSL (Tweaks/Developer/Configure_WSL.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   ENABLE WINDOWS SUBSYSTEM FOR LINUX (WSL)&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This script will enable the Virtual Machine Platform&quot;
Write-Host &quot;and WSL optional features natively. It will NOT&quot;
Write-Host &quot;install a specific Linux distro.&quot;
Write-Host &quot;Press &apos;Y&apos; to enable WSL or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Developer&quot; -Action &quot;Aborted WSL config&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Developer&quot; -Action &quot;Enabling WSL Optional Features&quot;

Write-Host &quot;`n[1/2] Enabling Windows Subsystem for Linux...&quot; -ForegroundColor Yellow
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart

Write-Host &quot;[2/2] Enabling Virtual Machine Platform...&quot; -ForegroundColor Yellow
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart

Write-FrameworkLog -ModuleName &quot;Developer&quot; -Action &quot;Completed WSL Feature Enablement&quot;

Write-Host &quot;`n[SUCCESS] WSL and Virtual Machine Platform are enabled.&quot; -ForegroundColor Green
Write-Host &quot;A SYSTEM RESTART IS REQUIRED for the changes to take effect.&quot; -ForegroundColor Red
Write-Host &quot;After rebooting, you can install a distro via &apos;wsl --install -d Ubuntu&apos;.&quot;


$null = Read-Host &quot;Press Enter to exit...&quot;


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Developer\Install_PowerShell_7.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Install PowerShell 7 (Tweaks/Developer/Install_PowerShell_7.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   INSTALL POWERSHELL 7 (CORE)&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;PowerShell 7 is the modern, open-source, cross-platform&quot;
Write-Host &quot;version of PowerShell that runs side-by-side with Windows PowerShell 5.1.&quot;
Write-Host &quot;Press &apos;Y&apos; to install or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Developer&quot; -Action &quot;Aborted PowerShell 7 Install&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

if (-not (Get-Command &quot;winget&quot; -ErrorAction SilentlyContinue)) {
    Write-Host &quot;`n[ERROR] WinGet is not installed or not in PATH.&quot; -ForegroundColor Red
    Exit
}

Write-FrameworkLog -ModuleName &quot;Developer&quot; -Action &quot;Installing PowerShell 7 via WinGet&quot;
Write-Host &quot;`nInstalling Microsoft.PowerShell...&quot; -ForegroundColor Yellow

Start-Process -FilePath &quot;winget&quot; -ArgumentList &quot;install&quot;, &quot;--id&quot;, &quot;Microsoft.PowerShell&quot;, &quot;--exact&quot;, &quot;--silent&quot;, &quot;--accept-package-agreements&quot;, &quot;--accept-source-agreements&quot; -Wait -NoNewWindow

Write-FrameworkLog -ModuleName &quot;Developer&quot; -Action &quot;Completed PowerShell 7 Install&quot;
Write-Host &quot;`n[SUCCESS] PowerShell 7 has been installed.&quot; -ForegroundColor Green
Write-Host &quot;It will appear in your Start Menu as &apos;PowerShell&apos; (black icon).&quot;


$null = Read-Host &quot;Press Enter to exit...&quot;


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Developer\Install_Windows_Terminal.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Install Windows Terminal (Tweaks/Developer/Install_Windows_Terminal.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   INSTALL WINDOWS TERMINAL&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;Windows Terminal is the modern, hardware-accelerated&quot;
Write-Host &quot;command-line experience for Windows with tabs and profiles.&quot;
Write-Host &quot;Press &apos;Y&apos; to install or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Developer&quot; -Action &quot;Aborted Windows Terminal Install&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

if (-not (Get-Command &quot;winget&quot; -ErrorAction SilentlyContinue)) {
    Write-Host &quot;`n[ERROR] WinGet is not installed or not in PATH.&quot; -ForegroundColor Red
    Exit
}

Write-FrameworkLog -ModuleName &quot;Developer&quot; -Action &quot;Installing Windows Terminal via WinGet&quot;
Write-Host &quot;`nInstalling Microsoft.WindowsTerminal...&quot; -ForegroundColor Yellow

Start-Process -FilePath &quot;winget&quot; -ArgumentList &quot;install&quot;, &quot;--id&quot;, &quot;Microsoft.WindowsTerminal&quot;, &quot;--exact&quot;, &quot;--silent&quot;, &quot;--accept-package-agreements&quot;, &quot;--accept-source-agreements&quot; -Wait -NoNewWindow

Write-FrameworkLog -ModuleName &quot;Developer&quot; -Action &quot;Completed Windows Terminal Install&quot;
Write-Host &quot;`n[SUCCESS] Windows Terminal has been installed.&quot; -ForegroundColor Green


$null = Read-Host &quot;Press Enter to exit...&quot;


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Diagnostics\Apply_Diagnostics_Privacy_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Diagnostics Privacy Profile (Tweaks/Diagnostics/Apply_Diagnostics_Privacy_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY DIAGNOSTICS PRIVACY PROFILE&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile disables OS-level telemetry and tracking.&quot;
Write-Host &quot;It blocks Windows from sending diagnostic data to Microsoft&quot;
Write-Host &quot;and disables personalized ads/tips based on your usage.&quot;
Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Diagnostics&quot; -Action &quot;Aborted Diagnostics Privacy Profile Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Diagnostics&quot; -Action &quot;Starting Master Diagnostics Privacy Orchestrator&quot; -Level WARNING

$ScriptDir = $PSScriptRoot

Write-Host &quot;`n[1/2] Disabling Diagnostic Data Collection (Telemetry)...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Diagnostic_Data.ps1&quot;) -Force:$Force

Write-Host &quot;`n[2/2] Disabling Tailored Experiences (Ads/Tips)...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Tailored_Experiences.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Diagnostics&quot; -Action &quot;Completed Master Diagnostics Privacy Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Diagnostics Privacy Profile deployment complete!&quot; -ForegroundColor Green
if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Diagnostics\Disable_Diagnostic_Data.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Diagnostic Data (Tweaks/Diagnostics/Disable_Diagnostic_Data.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Diagnostics&quot; -Action &quot;Initiating Diagnostic Data Disablement&quot;

$RegistryPath = &quot;HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection&quot;
if (-not (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null }
$Name = &quot;AllowTelemetry&quot;

# 1. Snapshot current state
$CurrentValue = (Get-ItemProperty -Path $RegistryPath -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentValue) { $CurrentValue = &quot;Not_Set&quot; }

# 2. Apply Configuration (0 = Disabled, 1 = Basic, 3 = Full)
Set-ItemProperty -Path $RegistryPath -Name $Name -Value 0 -Type DWord -Force

# 3. Log Outcome
Write-FrameworkLog -ModuleName &quot;Diagnostics&quot; -Action &quot;Disabled Windows Telemetry (AllowTelemetry)&quot; -OldValue $CurrentValue -NewValue &quot;0&quot;

Write-Host &quot;`n[SUCCESS] Windows Diagnostic Data collection (Telemetry) has been set to 0 (Disabled).&quot; -ForegroundColor Green
Write-Host &quot;This blocks the OS from sending usage metrics and system state data to Microsoft.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Diagnostics\Disable_Tailored_Experiences.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Tailored Experiences (Tweaks/Diagnostics/Disable_Tailored_Experiences.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Diagnostics&quot; -Action &quot;Initiating Tailored Experiences Disablement&quot;

$RegistryPath = &quot;HKCU:\Software\Policies\Microsoft\Windows\CloudContent&quot;
if (-not (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null }
$Name = &quot;DisableTailoredExperiencesWithDiagnosticData&quot;

# 1. Snapshot current state
$CurrentValue = (Get-ItemProperty -Path $RegistryPath -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentValue) { $CurrentValue = &quot;Not_Set&quot; }

# 2. Apply Configuration (1 = Disabled, 0 = Enabled)
Set-ItemProperty -Path $RegistryPath -Name $Name -Value 1 -Type DWord -Force

# 3. Log Outcome
Write-FrameworkLog -ModuleName &quot;Diagnostics&quot; -Action &quot;Disabled Tailored Experiences&quot; -OldValue $CurrentValue -NewValue &quot;1&quot;

Write-Host &quot;`n[SUCCESS] Windows Tailored Experiences have been disabled.&quot; -ForegroundColor Green
Write-Host &quot;Microsoft will no longer use your diagnostic data to serve personalized ads, tips, or recommendations.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Display\Auto SR Settings Guide.txt">
==============================================================================
GUIDE: Automatic Super Resolution (Auto SR) in Windows 11
TARGET SYSTEM: Windows 11 24H2 or later
==============================================================================

Automatic Super Resolution (Auto SR) is an AI-powered game upscaler integrated 
directly into Windows 11. It leverages the Neural Processing Unit (NPU) of 
modern Snapdragon-powered Copilot+ PCs to boost game frame rates while maintaining 
pristine visual clarity, leaving the GPU free for other processing.

--- SYSTEM REQUIREMENTS ---
To use Auto SR, your system must meet the following:
1. Processor: Snapdragon X Elite / Snapdragon X Plus (with integrated NPU).
2. OS Version: Windows 11 Version 24H2 (Build 26100) or later.
3. Display Resolution: 1080p or higher.
4. DirectX version: Game must run on DirectX 11 or DirectX 12.

--- HOW TO USE / CUSTOMIZE ---
Windows applies Auto SR automatically to a curated set of tested games, but you 
can manually force it on or off for ANY game:

1. Open Windows Graphics Settings (use our &quot;Open Graphics Settings.bat&quot; helper).
2. Look for &quot;Default settings&quot; and toggle &quot;Automatic super resolution&quot; ON to 
   enable it globally.
3. For individual games:
   - Scroll down to &quot;Custom settings for applications.&quot;
   - Click &quot;Browse&quot; and choose your game&apos;s .exe file if not already listed.
   - Click the game, then click &quot;Options.&quot;
   - Under &quot;Automatic super resolution,&quot; choose &quot;On&quot; or &quot;Off&quot;.

--- SAFETY &amp; COMPATIBILITY NOTES ---
- Auto SR and Auto HDR cannot be enabled at the same time for some games.
- To disable Auto SR, simply toggle it off globally in Graphics Settings or use 
  the per-app settings to change it to &quot;Off&quot;.
==============================================================================

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Display\HDR Settings &amp; Keyboard Shortcut.txt">
==============================================================================
GUIDE: HDR Settings &amp; Fast Toggle Keyboard Shortcut
TARGET SYSTEM: Windows 10 &amp; Windows 11
==============================================================================

To achieve the best visual fidelity and gaming latency, Windows 10/11 supports 
High Dynamic Range (HDR) for compatible monitors.

--- THE FAST SHORTCUT ---
You do not need to dive into Windows Settings every time you start or end a game!
You can toggle HDR instantly on your active display by pressing:

    [ Windows Key ] + [ Alt ] + [ B ]

* Note: This shortcut requires the &quot;Xbox Game Bar&quot; application installed (bundled 
  by default with Windows 10 and 11) to be running or enabled in background.

--- AUTO HDR (Windows 11 Only) ---
Auto HDR uses deep learning to automatically upgrade DirectX 11 and 12 SDR games 
to rich HDR colors without requiring any developer updates.
- Auto HDR works only when global HDR is active.
- To enable or configure it:
  1. Open Windows Settings (Win + I).
  2. Navigate to System &gt; Display &gt; HDR.
  3. Toggle &quot;Auto HDR&quot; to ON.

--- RESTORING / RESETTING ---
If your display flickers or looks washed out:
- Press [ Win + Alt + B ] again to instantly disable HDR.
- Or open standard Display Settings and verify your color profile / monitor calibration.
==============================================================================

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Display\Interactive_Manage_GPU_Preference.ps1">
# ==============================================================================
# SCRIPT: Manage Per-Game GPU Selection
# TARGET SYSTEM: Windows 10 &amp; Windows 11
# DESCRIPTION: Interactively assigns specific games or applications to either the
#              High Performance (discrete) GPU or Power Saving (integrated) GPU.
#              Also lists and removes configured application preferences.
# SAFETY LEVEL: Safe &amp; Fully Reversible
# ==============================================================================

$Host.UI.RawUI.WindowTitle = &quot;DirectX Graphics Preference Manager&quot;

# Clear Screen &amp; Print Beautiful Title
Clear-Host
Write-Host &quot;======================================================================&quot; -ForegroundColor Cyan
Write-Host &quot;                DIRECTX PER-GAME GPU PREFERENCE MANAGER               &quot; -ForegroundColor Cyan
Write-Host &quot;======================================================================&quot; -ForegroundColor Cyan
Write-Host &quot;&quot;

# Check Windows Version
$OS = Get-CimInstance Win32_OperatingSystem
$Build = [int]$OS.BuildNumber
Write-Host &quot;[*] OS: $($OS.Caption) (Build $Build)&quot; -ForegroundColor Gray
Write-Host &quot;&quot;

# Registry Path
$RegPath = &quot;HKCU:\Software\Microsoft\DirectX\UserGpuPreferences&quot;

# Ensure the key exists
if (-not (Test-Path $RegPath)) {
    New-Item -Path $RegPath -Force | Out-Null
}

function Show-Menu {
    Write-Host &quot;----------------------------------------------------------------------&quot; -ForegroundColor DarkGray
    Write-Host &quot;  1. View Current Custom Graphics Profiles&quot; -ForegroundColor White
    Write-Host &quot;  2. Add/Modify Game Graphics Profile&quot; -ForegroundColor White
    Write-Host &quot;  3. Remove a Game Graphics Profile&quot; -ForegroundColor White
    Write-Host &quot;  4. Exit&quot; -ForegroundColor White
    Write-Host &quot;----------------------------------------------------------------------&quot; -ForegroundColor DarkGray
    Write-Host &quot;&quot;
}

function List-Profiles {
    Clear-Host
    Write-Host &quot;=== Current Custom GPU Settings ===&quot; -ForegroundColor Cyan
    Write-Host &quot;&quot;
    
    $props = Get-Item -Path $RegPath | Select-Object -ExpandProperty Property -ErrorAction SilentlyContinue
    
    if (-not $props) {
        Write-Host &quot;No custom graphics preferences found in the registry.&quot; -ForegroundColor Yellow
        Write-Host &quot;&quot;
        return
    }

    $index = 1
    $profiles = @()
    foreach ($p in $props) {
        $val = (Get-ItemProperty -Path $RegPath -Name $p).$p
        
        # Parse value
        # Example format: &quot;GpuPreference=2;&quot; or &quot;GpuPreference=1;DefaultSetting=1;&quot;
        $pref = &quot;Default&quot;
        if ($val -like &quot;*GpuPreference=2*&quot;) { $pref = &quot;High Performance&quot; }
        elseif ($val -like &quot;*GpuPreference=1*&quot;) { $pref = &quot;Power Saving&quot; }
        elseif ($val -like &quot;*GpuPreference=0*&quot;) { $pref = &quot;System Default&quot; }

        Write-Host &quot;  [$index] App: $p&quot; -ForegroundColor White
        Write-Host &quot;       Setting: $pref ($val)&quot; -ForegroundColor Gray
        Write-Host &quot;&quot;
        
        $profiles += [PSCustomObject]@{
            Index = $index
            App = $p
            Value = $val
        }
        $index++
    }
    return $profiles
}

while ($true) {
    Show-Menu
    $choice = Read-Host &quot;Choose an option (1-4)&quot;
    
    switch ($choice) {
        &quot;1&quot; {
            List-Profiles | Out-Null
            Read-Host &quot;Press Enter to return to menu...&quot;
            Clear-Host
        }
        
        &quot;2&quot; {
            Clear-Host
            Write-Host &quot;=== Add/Modify Graphics Profile ===&quot; -ForegroundColor Cyan
            Write-Host &quot;&quot;
            Write-Host &quot;Enter the absolute path to the game executable (.exe):&quot; -ForegroundColor Gray
            $exePath = Read-Host &quot;Path&quot;
            
            # Remove quotes if user dragged and dropped the file
            $exePath = $exePath.Trim(&apos;&quot;&apos;).Trim(&quot;&apos;&quot;)

            if (-not (Test-Path $exePath)) {
                Write-Host &quot;&quot;
                Write-Host &quot;[!] Warning: The path specified was not found locally.&quot; -ForegroundColor Yellow
                Write-Host &quot;    Make sure the path is correct or double check if the game is installed.&quot; -ForegroundColor Yellow
                $confirm = Read-Host &quot;Do you want to save it anyway? (y/n)&quot;
                if ($confirm -ne &quot;y&quot;) {
                    Clear-Host
                    continue
                }
            }

            Write-Host &quot;&quot;
            Write-Host &quot;Select GPU Preference:&quot; -ForegroundColor White
            Write-Host &quot;  1. High Performance GPU (Discrete / Dedicated graphics card)&quot; -ForegroundColor Green
            Write-Host &quot;  2. Power Saving GPU (Integrated graphics chip)&quot; -ForegroundColor Yellow
            Write-Host &quot;  3. System Default&quot; -ForegroundColor Gray
            $prefChoice = Read-Host &quot;Choice (1-3)&quot;

            $prefVal = &quot;&quot;
            switch ($prefChoice) {
                &quot;1&quot; { $prefVal = &quot;GpuPreference=2;&quot; }
                &quot;2&quot; { $prefVal = &quot;GpuPreference=1;&quot; }
                &quot;3&quot; { $prefVal = &quot;GpuPreference=0;&quot; }
                default {
                    Write-Host &quot;Invalid preference selection.&quot; -ForegroundColor Red
                    Read-Host &quot;Press Enter to return...&quot;
                    Clear-Host
                    continue
                }
            }

            # Add to registry
            try {
                Set-ItemProperty -Path $RegPath -Name $exePath -Value $prefVal -Force | Out-Null
                Write-Host &quot;&quot;
                Write-Host &quot;[+] Successfully saved preference for $exePath!&quot; -ForegroundColor Green
                Write-Host &quot;    Setting applied: $prefVal&quot; -ForegroundColor Gray
            } catch {
                Write-Host &quot;[!] Error: Failed to write registry value.&quot; -ForegroundColor Red
                Write-Host $_.Exception.Message -ForegroundColor Gray
            }
            Write-Host &quot;&quot;
            Read-Host &quot;Press Enter to return...&quot;
            Clear-Host
        }
        
        &quot;3&quot; {
            $profiles = List-Profiles
            if (-not $profiles) {
                Read-Host &quot;Press Enter to return...&quot;
                Clear-Host
                continue
            }
            
            $delChoice = Read-Host &quot;Select profile number to remove (or &apos;q&apos; to cancel)&quot;
            if ($delChoice -eq &quot;q&quot;) {
                Clear-Host
                continue
            }

            $selected = $profiles | Where-Object { $_.Index -eq $delChoice }
            if ($selected) {
                try {
                    Remove-ItemProperty -Path $RegPath -Name $selected.App -Force | Out-Null
                    Write-Host &quot;&quot;
                    Write-Host &quot;[+] Successfully removed graphics profile for $($selected.App)!&quot; -ForegroundColor Green
                } catch {
                    Write-Host &quot;[!] Error: Failed to remove registry value.&quot; -ForegroundColor Red
                }
            } else {
                Write-Host &quot;Invalid selection.&quot; -ForegroundColor Red
            }
            Write-Host &quot;&quot;
            Read-Host &quot;Press Enter to return...&quot;
            Clear-Host
        }
        
        &quot;4&quot; {
            Write-Host &quot;Exiting...&quot; -ForegroundColor Cyan
            exit
        }
        
        default {
            Write-Host &quot;Invalid choice, please select 1-4.&quot; -ForegroundColor Red
            Start-Sleep -Seconds 1
            Clear-Host
        }
    }
}

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Display\Open Graphics Settings.bat">
@echo off
:: ==============================================================================
; HELPER: Open Graphics Settings Panel
; TARGET SYSTEM: Windows 10 &amp; Windows 11
; DESCRIPTION: Launches the advanced graphics preference settings app directly.
;              Useful for managing Auto SR, HDR, and global graphics settings.
; ==============================================================================
title Open Graphics Settings

echo Opening Windows Display Graphics settings panel...
start ms-settings:display-advancedgraphics
exit

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Drivers\Analyze_DPC_Latency.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Analyze DPC Latency (Tweaks/Drivers/Analyze_DPC_Latency.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

Write-Host &quot;=================================================&quot;
Write-Host &quot;   DPC LATENCY &amp; ISR ANALYZER (NATIVE)&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;High DPC (Deferred Procedure Call) time causes audio crackling,&quot;
Write-Host &quot;mouse stutters, and frame drops. This script monitors the CPU&quot;
Write-Host &quot;for DPC/ISR spikes over a 10-second window.&quot;
Write-Host &quot;=================================================`n&quot;

Write-Host &quot;Sampling DPC and ISR processor times for 10 seconds. Do not move your mouse...&quot; -ForegroundColor Yellow

# Collect performance counters for Processor Time, DPC Time, and Interrupt Time
$Counters = &quot;\Processor Information(_Total)\% DPC Time&quot;, &quot;\Processor Information(_Total)\% Interrupt Time&quot;, &quot;\Processor Information(_Total)\% Processor Time&quot;
$Samples = Get-Counter -Counter $Counters -SampleInterval 1 -MaxSamples 10 -ErrorAction SilentlyContinue

if (-not $Samples) {
    Write-Host &quot;[ERROR] Could not read performance counters. Performance counters may be disabled/corrupt.&quot; -ForegroundColor Red
    Exit
}

$DpcValues = @()
$IsrValues = @()

foreach ($Sample in $Samples) {
    $DpcValues += $Sample.CounterSamples | Where-Object Path -match &quot;dpc&quot; | Select-Object -ExpandProperty CookedValue
    $IsrValues += $Sample.CounterSamples | Where-Object Path -match &quot;interrupt&quot; | Select-Object -ExpandProperty CookedValue
}

$AvgDPC = ($DpcValues | Measure-Object -Average).Average
$MaxDPC = ($DpcValues | Measure-Object -Maximum).Maximum
$AvgISR = ($IsrValues | Measure-Object -Average).Average

Write-Host &quot;`n--- ANALYSIS RESULTS ---&quot; -ForegroundColor Cyan
Write-Host &quot;Average DPC Time: $([math]::Round($AvgDPC, 4)) %&quot;
Write-Host &quot;Maximum DPC Spike: $([math]::Round($MaxDPC, 4)) %&quot;
Write-Host &quot;Average ISR Time: $([math]::Round($AvgISR, 4)) %&quot;

if ($MaxDPC -gt 5.0) {
    Write-Host &quot;`n[WARNING] High DPC latency spikes detected!&quot; -ForegroundColor Red
    Write-Host &quot;A driver is taking too long to execute. Common culprits:&quot;
    Write-Host &quot;- Outdated NVIDIA/AMD GPU Drivers (use DDU)&quot;
    Write-Host &quot;- Realtek Audio Drivers&quot;
    Write-Host &quot;- Wi-Fi or Ethernet network drivers&quot;
    Write-Host &quot;Recommendation: Download &apos;LatencyMon&apos; for deep driver-level analysis.&quot;
} else {
    Write-Host &quot;`n[SUCCESS] Your DPC execution times are well within normal bounds.&quot; -ForegroundColor Green
    Write-Host &quot;System should be responsive and free of audio crackling.&quot;
}

Write-Host &quot;`nPress any key to exit...&quot;
if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Drivers\Backup_Installed_Drivers.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Backup Installed Drivers (Tweaks/Drivers/Backup_Installed_Drivers.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force
$BackupRoot = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Restore\Drivers&quot;

Write-Host &quot;=================================================&quot;
Write-Host &quot;   DRIVER BACKUP UTILITY (DISM)&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This will export all third-party drivers currently installed&quot;
Write-Host &quot;on your system to a safe backup directory. This is critical&quot;
Write-Host &quot;before doing major optimizations or GPU driver cleanups (DDU).&quot;
Write-Host &quot;Press &apos;Y&apos; to begin the backup or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Drivers&quot; -Action &quot;Aborted Driver Backup&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

$Timestamp = Get-Date -Format &quot;yyyyMMdd_HHmmss&quot;
$ExportDir = Join-Path -Path $BackupRoot -ChildPath &quot;Backup_$Timestamp&quot;

if (-not (Test-Path $ExportDir)) {
    New-Item -Path $ExportDir -ItemType Directory -Force | Out-Null
}

Write-FrameworkLog -ModuleName &quot;Drivers&quot; -Action &quot;Started third-party driver export&quot;

Write-Host &quot;`nExporting drivers. This may take a few minutes...&quot; -ForegroundColor Yellow
dism.exe /online /export-driver /destination:&quot;$ExportDir&quot; | Out-Null

Write-FrameworkLog -ModuleName &quot;Drivers&quot; -Action &quot;Completed third-party driver export to $ExportDir&quot;

Write-Host &quot;`n=================================================&quot;
Write-Host &quot;[SUCCESS] Drivers have been exported safely.&quot; -ForegroundColor Green
Write-Host &quot;Backup Location: $ExportDir&quot;
if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Drivers\Disable_Automatic_Driver_Replacement.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Automatic Driver Replacement (Tweaks/Drivers/Disable_Automatic_Driver_Replacement.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force
$SnapshotDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Restore&quot;

Write-Host &quot;=================================================&quot;
Write-Host &quot;   AUTOMATIC DRIVER REPLACEMENT MANAGER&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;Windows Update often silently downgrades or replaces&quot;
Write-Host &quot;perfectly functioning AMD/NVIDIA GPU or network drivers.&quot;
Write-Host &quot;This script configures group policies to exclude drivers&quot;
Write-Host &quot;from standard Windows Updates.&quot;
Write-Host &quot;=================================================&quot;
Write-Host &quot;1. Disable Driver Updates via Windows Update (Recommended)&quot;
Write-Host &quot;2. Enable Driver Updates via Windows Update (Default)&quot;
Write-Host &quot;3. Abort&quot;
Write-Host &quot;=================================================&quot;
$Choice = Read-Host &quot;Select an option [1-3]&quot;

if ($Choice -notmatch &apos;^[1-2]$&apos;) {
    Write-FrameworkLog -ModuleName &quot;Drivers&quot; -Action &quot;Aborted Driver Update config&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Drivers&quot; -Action &quot;Backing up Driver Update registry keys&quot;
$RegPath1 = &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate&quot;
$BackupFile = Join-Path -Path $SnapshotDir -ChildPath &quot;DriverUpdates_Backup_$(Get-Date -Format &apos;yyyyMMdd_HHmmss&apos;).reg&quot;
&amp; reg export $RegPath1 $BackupFile /y 2&gt;$null | Out-Null

$KeyPath = &quot;HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate&quot;
if (-not (Test-Path $KeyPath)) { New-Item -Path $KeyPath -Force | Out-Null }

if ($Choice -eq &apos;1&apos;) {
    Write-Host &quot;`nDisabling driver inclusion in Windows Update...&quot; -ForegroundColor Yellow
    Set-ItemProperty -Path $KeyPath -Name &quot;ExcludeWUDriversInQualityUpdate&quot; -Value 1 -Type DWord -Force
    Write-FrameworkLog -ModuleName &quot;Drivers&quot; -Action &quot;Disabled Windows Update from installing drivers&quot;
    Write-Host &quot;[SUCCESS] Windows Update will no longer replace your drivers.&quot; -ForegroundColor Green
} else {
    Write-Host &quot;`nEnabling driver inclusion in Windows Update...&quot; -ForegroundColor Yellow
    Set-ItemProperty -Path $KeyPath -Name &quot;ExcludeWUDriversInQualityUpdate&quot; -Value 0 -Type DWord -Force
    Write-FrameworkLog -ModuleName &quot;Drivers&quot; -Action &quot;Enabled Windows Update to install drivers&quot;
    Write-Host &quot;[SUCCESS] Windows Update will manage your drivers.&quot; -ForegroundColor Green
}



$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Explorer\Apply_Productivity_Explorer.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Productivity Explorer Orchestrator (Tweaks/Explorer/Apply_Productivity_Explorer.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY PRODUCTIVITY EXPLORER PRESET&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This will configure Developer View, This PC launch, Compact View, Classic Context Menus,&quot;
Write-Host &quot;and disable Recent/Frequent file tracking.&quot;
Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Explorer&quot; -Action &quot;Aborted Productivity Explorer Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Explorer&quot; -Action &quot;Starting Master Productivity Explorer Orchestrator&quot; -Level WARNING

$ScriptDir = $PSScriptRoot

Write-Host &quot;`n[1/5] Configuring Developer View (Extensions, Hidden Files)...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Configure_Developer_View.ps1&quot;) -Force:$Force

Write-Host &quot;`n[2/5] Setting File Explorer default to &apos;This PC&apos;...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Set_Launch_To_This_PC.ps1&quot;) -Force:$Force

Write-Host &quot;`n[3/5] Disabling Recent Files and Frequent Folders tracking...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Recent_Frequent.ps1&quot;) -Force:$Force

Write-Host &quot;`n[4/5] Enabling Compact View for higher information density...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Enable_Compact_View.ps1&quot;) -Force:$Force

Write-Host &quot;`n[5/5] Restoring Classic Context Menus...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Restore_Classic_ContextMenu.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Explorer&quot; -Action &quot;Completed Master Productivity Explorer Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Productivity Explorer deployment complete!&quot; -ForegroundColor Green
Write-Host &quot;Restarting Windows Explorer to apply all visual changes immediately...&quot; -ForegroundColor Yellow
Stop-Process -Name &quot;explorer&quot; -Force

if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Explorer\Configure_Developer_View.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Configure Developer View for Explorer (Tweaks/Explorer/Configure_Developer_View.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Explorer&quot; -Action &quot;Initiating Developer View Configuration&quot;

$RegistryPath = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced&quot;

# Setting 1: Show Hidden Files (1 = Show, 2 = Hide)
$HiddenVal = (Get-ItemProperty -Path $RegistryPath -Name &quot;Hidden&quot; -ErrorAction SilentlyContinue).Hidden
if ($null -eq $HiddenVal) { $HiddenVal = &quot;Not_Set&quot; }
Set-ItemProperty -Path $RegistryPath -Name &quot;Hidden&quot; -Value 1 -Type DWord -Force
Write-FrameworkLog -ModuleName &quot;Explorer&quot; -Action &quot;Show Hidden Files&quot; -OldValue $HiddenVal -NewValue &quot;1&quot;

# Setting 2: Show File Extensions (0 = Show, 1 = Hide)
$ExtVal = (Get-ItemProperty -Path $RegistryPath -Name &quot;HideFileExt&quot; -ErrorAction SilentlyContinue).HideFileExt
if ($null -eq $ExtVal) { $ExtVal = &quot;Not_Set&quot; }
Set-ItemProperty -Path $RegistryPath -Name &quot;HideFileExt&quot; -Value 0 -Type DWord -Force
Write-FrameworkLog -ModuleName &quot;Explorer&quot; -Action &quot;Show File Extensions&quot; -OldValue $ExtVal -NewValue &quot;0&quot;

# Setting 3: Show Protected OS Files (1 = Show, 0 = Hide)
$SuperHiddenVal = (Get-ItemProperty -Path $RegistryPath -Name &quot;ShowSuperHidden&quot; -ErrorAction SilentlyContinue).ShowSuperHidden
if ($null -eq $SuperHiddenVal) { $SuperHiddenVal = &quot;Not_Set&quot; }
Set-ItemProperty -Path $RegistryPath -Name &quot;ShowSuperHidden&quot; -Value 1 -Type DWord -Force
Write-FrameworkLog -ModuleName &quot;Explorer&quot; -Action &quot;Show Protected OS Files&quot; -OldValue $SuperHiddenVal -NewValue &quot;1&quot;

Write-Host &quot;`n[SUCCESS] Developer View Configured (Extensions, Hidden Files, and OS Files are now visible).&quot; -ForegroundColor Green


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Explorer\Disable_Recent_Frequent.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Recent Files and Frequent Folders (Tweaks/Explorer/Disable_Recent_Frequent.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Explorer&quot; -Action &quot;Initiating Recent/Frequent Tracking Cleanup&quot;

$RegistryPath = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer&quot;

# Setting 1: Show Recent Files (0 = Hide, 1 = Show)
$RecentVal = (Get-ItemProperty -Path $RegistryPath -Name &quot;ShowRecent&quot; -ErrorAction SilentlyContinue).ShowRecent
if ($null -eq $RecentVal) { $RecentVal = &quot;Not_Set&quot; }
Set-ItemProperty -Path $RegistryPath -Name &quot;ShowRecent&quot; -Value 0 -Type DWord -Force
Write-FrameworkLog -ModuleName &quot;Explorer&quot; -Action &quot;Disable Show Recent Files&quot; -OldValue $RecentVal -NewValue &quot;0&quot;

# Setting 2: Show Frequent Folders (0 = Hide, 1 = Show)
$FrequentVal = (Get-ItemProperty -Path $RegistryPath -Name &quot;ShowFrequent&quot; -ErrorAction SilentlyContinue).ShowFrequent
if ($null -eq $FrequentVal) { $FrequentVal = &quot;Not_Set&quot; }
Set-ItemProperty -Path $RegistryPath -Name &quot;ShowFrequent&quot; -Value 0 -Type DWord -Force
Write-FrameworkLog -ModuleName &quot;Explorer&quot; -Action &quot;Disable Show Frequent Folders&quot; -OldValue $FrequentVal -NewValue &quot;0&quot;

Write-Host &quot;`n[SUCCESS] Recent files and Frequent folders have been hidden from Explorer.&quot; -ForegroundColor Green


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Explorer\Set_Launch_To_This_PC.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Set Launch Explorer to This PC (Tweaks/Explorer/Set_Launch_To_This_PC.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Explorer&quot; -Action &quot;Initiating This PC Launch Configuration&quot;

$RegistryPath = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced&quot;
$Name = &quot;LaunchTo&quot;

# 1. Snapshot current state for reversibility
$CurrentValue = (Get-ItemProperty -Path $RegistryPath -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentValue) { $CurrentValue = &quot;Not_Set&quot; }

# 2. Apply Configuration (1 = This PC, 2 = Quick Access / Home)
Set-ItemProperty -Path $RegistryPath -Name $Name -Value 1 -Type DWord -Force

# 3. Log Outcome
Write-FrameworkLog -ModuleName &quot;Explorer&quot; -Action &quot;Set Explorer Launch to This PC&quot; -OldValue $CurrentValue -NewValue &quot;1&quot;

Write-Host &quot;`n[SUCCESS] File Explorer will now open to &apos;This PC&apos; by default.&quot; -ForegroundColor Green


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\GPU\Apply_Gaming_GPU_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Gaming GPU Profile (Tweaks/GPU/Apply_Gaming_GPU_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY GAMING GPU PROFILE&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile configures Windows to prioritize game performance.&quot;
Write-Host &quot;It enables Hardware Accelerated GPU Scheduling (HAGS) for higher FPS&quot;
Write-Host &quot;and enables Windows Game Mode to suppress background activity.&quot;
Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;GPU&quot; -Action &quot;Aborted Gaming GPU Profile Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;GPU&quot; -Action &quot;Starting Master Gaming GPU Orchestrator&quot; -Level WARNING

$ScriptDir = $PSScriptRoot

Write-Host &quot;`n[1/2] Enabling Hardware Accelerated GPU Scheduling...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Enable_Hardware_Accelerated_GPU_Scheduling.ps1&quot;) -Force:$Force

Write-Host &quot;`n[2/2] Enabling Windows Game Mode...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Enable_Game_Mode.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;GPU&quot; -Action &quot;Completed Master Gaming GPU Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Gaming GPU Profile deployment complete!&quot; -ForegroundColor Green
Write-Host &quot;A system reboot is highly recommended to apply GPU scheduling changes.&quot; -ForegroundColor Red
if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Input\Disable Mouse Acceleration.reg">
Windows Registry Editor Version 5.00

; WinAurex Windows Optimization Framework
; Tweaks\Input\Disable Mouse Acceleration.reg
; Disables Enhance Pointer Precision and flattens cursor scaling curves for 1:1 input.

[HKEY_CURRENT_USER\Control Panel\Mouse]
&quot;MouseSpeed&quot;=&quot;0&quot;
&quot;MouseThreshold1&quot;=&quot;0&quot;
&quot;MouseThreshold2&quot;=&quot;0&quot;
&quot;SmoothMouseXCurve&quot;=hex:00,00,00,00,00,00,00,00,15,6e,00,00,00,00,00,00,00,40,\
  01,00,00,00,00,00,29,dc,03,00,00,00,00,00,00,00,28,00,00,00,00,00
&quot;SmoothMouseYCurve&quot;=hex:00,00,00,00,00,00,00,00,15,6e,00,00,00,00,00,00,00,40,\
  01,00,00,00,00,00,29,dc,03,00,00,00,00,00,00,00,28,00,00,00,00,00

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Input\Disable_Mouse_Acceleration.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Mouse Acceleration (Tweaks/Input/Disable_Mouse_Acceleration.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -ErrorAction SilentlyContinue
$SnapshotDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Restore\Input&quot;

if (-not (Test-Path $SnapshotDir)) { New-Item -Path $SnapshotDir -ItemType Directory -Force | Out-Null }

Write-Host &quot;=================================================&quot;
Write-Host &quot;   DISABLE MOUSE ACCELERATION (E.P.P.)&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;Windows &apos;Enhance Pointer Precision&apos; artificially scales&quot;
Write-Host &quot;mouse movement based on speed, which destroys muscle&quot;
Write-Host &quot;memory in competitive FPS games.&quot;
Write-Host &quot;=================================================&quot;

Write-FrameworkLog -ModuleName &quot;Input&quot; -Action &quot;Backing up Mouse registry keys before disabling&quot; -ErrorAction SilentlyContinue
$RegPath1 = &quot;HKCU\Control Panel\Mouse&quot;
$BackupFile = Join-Path -Path $SnapshotDir -ChildPath &quot;Mouse_Backup_BeforeDisable_$(Get-Date -Format &apos;yyyyMMdd_HHmmss&apos;).reg&quot;
&amp; reg export $RegPath1 $BackupFile /y | Out-Null

$MouseKey = &quot;HKCU:\Control Panel\Mouse&quot;

Write-Host &quot;`nDisabling Enhance Pointer Precision...&quot; -ForegroundColor Yellow
Set-ItemProperty -Path $MouseKey -Name &quot;MouseSpeed&quot; -Value &quot;0&quot; -Type String -Force
Set-ItemProperty -Path $MouseKey -Name &quot;MouseThreshold1&quot; -Value &quot;0&quot; -Type String -Force
Set-ItemProperty -Path $MouseKey -Name &quot;MouseThreshold2&quot; -Value &quot;0&quot; -Type String -Force

# Flatten mouse acceleration curves (MarkC 1-to-1 input curves)
$SmoothCurve = [byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x00,0x00,0x00,0x00,0x00,0x29,0xdc,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x00,0x00)
Set-ItemProperty -Path $MouseKey -Name &quot;SmoothMouseXCurve&quot; -Value $SmoothCurve -Type Binary -Force
Set-ItemProperty -Path $MouseKey -Name &quot;SmoothMouseYCurve&quot; -Value $SmoothCurve -Type Binary -Force

Write-FrameworkLog -ModuleName &quot;Input&quot; -Action &quot;Disabled Mouse Acceleration (EPP)&quot; -ErrorAction SilentlyContinue
Write-Host &quot;[SUCCESS] Mouse Acceleration is DISABLED. You now have 1:1 input.&quot; -ForegroundColor Green

Write-Host &quot;You must LOG OUT or RESTART for the cursor curve to fully update.&quot; -ForegroundColor Yellow

$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Input\USB_Polling_Diagnostics.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# USB Polling &amp; Input Diagnostics (Tweaks/Input/USB_Polling_Diagnostics.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

Write-Host &quot;=================================================&quot;
Write-Host &quot;   USB &amp; INPUT POLLING DIAGNOSTICS&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This script enumerates USB controllers and HID devices&quot;
Write-Host &quot;to check for power saving states that can induce input lag.&quot;
Write-Host &quot;=================================================`n&quot;

Write-Host &quot;Analyzing USB Root Hubs Power Management...&quot; -ForegroundColor Yellow

$USBHubs = Get-WmiObject -Class Win32_USBHub
$FoundIssues = $false

foreach ($Hub in $USBHubs) {
    # We check if power management is enabled for USB Hubs
    # In WMI, this is often tricky without diving into CIM or registry directly,
    # but we can list the hubs to identify overloaded controllers.
    Write-Host &quot;Found Hub: $($Hub.Name) [$($Hub.DeviceID)]&quot; -ForegroundColor Cyan
}

Write-Host &quot;`nChecking Power Management Settings for USB (Registry)...&quot; -ForegroundColor Yellow
# DisableSelectiveSuspend is located in USB settings
$USBRegistryPath = &quot;HKLM:\SYSTEM\CurrentControlSet\Services\USB&quot;
if (-not (Test-Path $USBRegistryPath)) {
    Write-Host &quot;[WARNING] USB root key not found, creating for configuration.&quot; -ForegroundColor Yellow
    New-Item -Path $USBRegistryPath -Force | Out-Null
}

$SelectiveSuspend = Get-ItemProperty -Path $USBRegistryPath -Name &quot;DisableSelectiveSuspend&quot; -ErrorAction SilentlyContinue

if ($SelectiveSuspend.DisableSelectiveSuspend -eq 1) {
    Write-Host &quot;[OK] USB Selective Suspend is globally DISABLED (Optimal for Input Latency).&quot; -ForegroundColor Green
} else {
    Write-Host &quot;[WARNING] USB Selective Suspend is ENABLED (May cause mouse stutter when waking from idle).&quot; -ForegroundColor Red
    $FoundIssues = $true
}

if ($FoundIssues) {
    Write-Host &quot;`nDo you want to disable USB Selective Suspend globally to fix input latency? (Y/N)&quot;
    if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }
    
    if ($Confirm -match &apos;y&apos;) {
        Set-ItemProperty -Path $USBRegistryPath -Name &quot;DisableSelectiveSuspend&quot; -Value 1 -Type DWord -Force
        Write-Host &quot;`n[SUCCESS] USB Selective Suspend has been disabled.&quot; -ForegroundColor Green
        
        $HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
        Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force -ErrorAction SilentlyContinue
        Write-FrameworkLog -ModuleName &quot;Input&quot; -Action &quot;Disabled USB Selective Suspend&quot;
    } else {
        Write-Host &quot;`nNo changes made.&quot;
    }
}

Write-Host &quot;`nNOTE: High-polling rate mice (4000Hz - 8000Hz) require raw CPU performance.&quot;
Write-Host &quot;If you experience stutter at 8000Hz, drop your mouse software to 2000Hz.&quot;
if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Network\Cap Delivery Optimization Bandwidth.reg">
Windows Registry Editor Version 5.00

; ==============================================================================
; TWEAK: Cap Delivery Optimization Bandwidth
; TARGET SYSTEM: Windows 10 &amp; Windows 11
; DESCRIPTION: Restricts foreground/background download speed and upload speed 
;              used by Windows Updates. Highly recommended for users on limited 
;              data plans, cellular hotspots, or unstable high-latency connections.
;              - Background Download capped at 100 KB/s (800 kbps)
;              - Foreground Download capped at 1000 KB/s (8 Mbps)
;              - Upload sharing bandwidth capped at 50 KB/s (400 kbps)
; SAFETY LEVEL: Safe &amp; Reversible
; ==============================================================================

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config]
; Capping background update download bandwidth (in KB/s)
&quot;DOMaxBackgroundDownloadBandwidth&quot;=dword:00000064
; Capping foreground update download bandwidth (in KB/s)
&quot;DOMaxForegroundDownloadBandwidth&quot;=dword:000003e8
; Capping background upload sharing bandwidth (in KB/s)
&quot;DOMaxUploadBandwidth&quot;=dword:00000032

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization]
&quot;DOMaxBackgroundDownloadBandwidth&quot;=dword:00000064
&quot;DOMaxForegroundDownloadBandwidth&quot;=dword:000003e8
&quot;DOMaxUploadBandwidth&quot;=dword:00000032

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Network\Disable Peer to Peer Updates.reg">
Windows Registry Editor Version 5.00

; ==============================================================================
; TWEAK: Disable Delivery Optimization Peer-to-Peer Updates
; TARGET SYSTEM: Windows 10 &amp; Windows 11
; DESCRIPTION: Disables local network (LAN) and internet peer-to-peer sharing 
;              of Windows updates. Directs Windows to pull updates exclusively 
;              from Microsoft servers. This saves background upload/download 
;              bandwidth and reduces game packet loss.
; SAFETY LEVEL: Safe &amp; Reversible
; ==============================================================================

; --- Current User Configuration ---
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization]
&quot;DODownloadMode&quot;=dword:00000000

; --- System-wide Configuration ---
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config]
&quot;DODownloadMode&quot;=dword:00000000
&quot;DownloadMode_BackCompat&quot;=dword:00000000

; --- Policy / Group Policy Enforced Override ---
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization]
&quot;DODownloadMode&quot;=dword:00000000

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Network-Diagnostics\Reset_Network_Stack.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Reset Network Stack (Tweaks/Network-Diagnostics/Reset_Network_Stack.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   RESET NETWORK STACK&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This will completely reset the Windows TCP/IP stack,&quot;
Write-Host &quot;flush DNS, and reset Winsock. This is highly effective&quot;
Write-Host &quot;for fixing random lag spikes or connectivity drops.&quot;
Write-Host &quot;WARNING: A reboot will be required after this completes.&quot;
Write-Host &quot;Press &apos;Y&apos; to confirm or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Network&quot; -Action &quot;Aborted Network Stack Reset&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Network&quot; -Action &quot;Initiating Full Network Stack Reset&quot; -Level WARNING

Write-Host &quot;`n[1/3] Flushing DNS Cache...&quot; -ForegroundColor Cyan
ipconfig /flushdns | Out-Null

Write-Host &quot;[2/3] Resetting Winsock Catalog...&quot; -ForegroundColor Cyan
netsh winsock reset | Out-Null

Write-Host &quot;[3/3] Resetting TCP/IP Stack...&quot; -ForegroundColor Cyan
netsh int ip reset | Out-Null

Write-FrameworkLog -ModuleName &quot;Network&quot; -Action &quot;Completed Network Stack Reset&quot;

Write-Host &quot;`n[SUCCESS] Network stack has been successfully reset.&quot; -ForegroundColor Green
Write-Host &quot;Please RESTART YOUR COMPUTER to finish the process.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Network-Diagnostics\Test_Latency_To_Game_Servers.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Test Latency To Game Servers (Tweaks/Network-Diagnostics/Test_Latency_To_Game_Servers.ps1)

Write-Host &quot;=================================================&quot;
Write-Host &quot;   NETWORK LATENCY DIAGNOSTICS&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;Testing ICMP Ping latency to major cloud providers&quot;
Write-Host &quot;often used to host multiplayer game servers...&quot;
Write-Host &quot;=================================================`n&quot;

$Endpoints = @{
    &quot;Cloudflare (Global Routing)&quot; = &quot;1.1.1.1&quot;
    &quot;Google (Global Routing)&quot; = &quot;8.8.8.8&quot;
    &quot;AWS US East (N. Virginia)&quot; = &quot;dynamodb.us-east-1.amazonaws.com&quot;
    &quot;AWS EU West (Ireland)&quot; = &quot;dynamodb.eu-west-1.amazonaws.com&quot;
    &quot;AWS AP (Tokyo)&quot; = &quot;dynamodb.ap-northeast-1.amazonaws.com&quot;
    &quot;Azure US East&quot; = &quot;blob.core.windows.net&quot;
}

foreach ($Key in $Endpoints.Keys) {
    Write-Host &quot;Pinging $Key ($($Endpoints[$Key]))...&quot;
    $Result = Test-Connection -ComputerName $Endpoints[$Key] -Count 4 -ErrorAction SilentlyContinue
    
    if ($Result) {
        $AvgLatency = ($Result | Measure-Object -Property ResponseTime -Average).Average
        $Color = &quot;Green&quot;
        if ($AvgLatency -gt 80) { $Color = &quot;Yellow&quot; }
        if ($AvgLatency -gt 150) { $Color = &quot;Red&quot; }
        
        Write-Host &quot;-&gt; Average Ping: $([math]::Round($AvgLatency)) ms`n&quot; -ForegroundColor $Color
    } else {
        Write-Host &quot;-&gt; Request Timed Out (Host may block ICMP)`n&quot; -ForegroundColor DarkGray
    }
}

Write-Host &quot;=================================================&quot;
Write-Host &quot;NOTE: If all servers show high ping (&gt;100ms) or drop packets,&quot;
Write-Host &quot;try running &apos;Reset_Network_Stack.ps1&apos; or check your router.&quot;
Write-Host &quot;=================================================&quot;
if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Power\Apply_Desktop_Power_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Desktop Power Profile (Tweaks/Power/Apply_Desktop_Power_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY DESKTOP POWER PROFILE&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile configures your system for maximum consistent performance.&quot;
Write-Host &quot;It disables hibernation (freeing SSD space), sets Ultimate Performance,&quot;
Write-Host &quot;and prevents USB devices from sleeping.&quot;
Write-Host &quot;WARNING: DO NOT use this on a laptop that runs on battery.&quot; -ForegroundColor Red
Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Power&quot; -Action &quot;Aborted Desktop Power Profile Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Power&quot; -Action &quot;Starting Master Desktop Power Orchestrator&quot; -Level WARNING

$ScriptDir = $PSScriptRoot

Write-Host &quot;`n[1/3] Disabling Hibernation...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Hibernation.ps1&quot;) -Force:$Force

Write-Host &quot;`n[2/3] Enabling Ultimate Performance Plan...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Enable_Ultimate_Performance_Plan.ps1&quot;) -Force:$Force

Write-Host &quot;`n[3/3] Disabling USB Selective Suspend...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_USB_Selective_Suspend.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Power&quot; -Action &quot;Completed Master Desktop Power Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Desktop Power Profile deployment complete!&quot; -ForegroundColor Green
if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Power\Apply_Laptop_Battery_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Laptop Battery Profile (Tweaks/Power/Apply_Laptop_Battery_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY LAPTOP BATTERY PROFILE&quot; -ForegroundColor Green
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile configures your system to preserve battery life and thermals.&quot;
Write-Host &quot;It enables hibernation, sets the Balanced power plan, and allows&quot;
Write-Host &quot;USB devices to sleep when not in use.&quot;
Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Power&quot; -Action &quot;Aborted Laptop Battery Profile Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Power&quot; -Action &quot;Starting Master Laptop Battery Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[1/3] Enabling Hibernation (for deep sleep)...&quot; -ForegroundColor Cyan
powercfg.exe /h on
Write-FrameworkLog -ModuleName &quot;Power&quot; -Action &quot;Enabled Windows Hibernation&quot; -OldValue &quot;Disabled&quot; -NewValue &quot;Enabled&quot;

Write-Host &quot;`n[2/3] Setting Balanced Power Plan...&quot; -ForegroundColor Cyan
# 381b4222-f694-41d0-9685-ff5bb260df2e is the standard GUID for Balanced
powercfg /setactive 381b4222-f694-41d0-9685-ff5bb260df2e
Write-FrameworkLog -ModuleName &quot;Power&quot; -Action &quot;Enabled Balanced Power Plan&quot; -OldValue &quot;Unknown&quot; -NewValue &quot;381b4222-f694-41d0-9685-ff5bb260df2e&quot;

Write-Host &quot;`n[3/3] Enabling USB Selective Suspend (battery saving)...&quot; -ForegroundColor Cyan
powercfg /SETACVALUEINDEX SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bea1222653 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 1
powercfg /SETDCVALUEINDEX SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bea1222653 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 1
powercfg /S SCHEME_CURRENT
Write-FrameworkLog -ModuleName &quot;Power&quot; -Action &quot;Enabled USB Selective Suspend&quot; -OldValue &quot;Unknown&quot; -NewValue &quot;1&quot;

Write-FrameworkLog -ModuleName &quot;Power&quot; -Action &quot;Completed Master Laptop Battery Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Laptop Battery Profile deployment complete!&quot; -ForegroundColor Green
if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Power\Disable_Hibernation.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Hibernation (Tweaks/Power/Disable_Hibernation.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Power&quot; -Action &quot;Initiating Hibernation Disablement&quot;

# 1. Disable Hibernation via powercfg
powercfg.exe /h off
$Success = ($LASTEXITCODE -eq 0)

if ($Success) {
    Write-FrameworkLog -ModuleName &quot;Power&quot; -Action &quot;Disabled Windows Hibernation&quot; -OldValue &quot;Enabled&quot; -NewValue &quot;Disabled&quot;
    Write-Host &quot;`n[SUCCESS] Hibernation disabled. The hiberfil.sys file has been removed, freeing up SSD space.&quot; -ForegroundColor Green
} else {
    Write-FrameworkLog -ModuleName &quot;Power&quot; -Action &quot;Failed to Disable Windows Hibernation&quot; -Level ERROR
    Write-Host &quot;`n[ERROR] Failed to disable hibernation. Ensure you have administrator rights.&quot; -ForegroundColor Red
}



$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Power\Disable_USB_Selective_Suspend.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable USB Selective Suspend (Tweaks/Power/Disable_USB_Selective_Suspend.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Power&quot; -Action &quot;Initiating USB Selective Suspend Disablement&quot;

# GUIDs for USB settings
# Subgroup: 2a737441-1930-4402-8d77-b2bea1222653 (USB Settings)
# Setting: 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 (USB selective suspend setting)

powercfg /SETACVALUEINDEX SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bea1222653 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 0
powercfg /SETDCVALUEINDEX SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bea1222653 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 0
powercfg /S SCHEME_CURRENT

Write-FrameworkLog -ModuleName &quot;Power&quot; -Action &quot;Disabled USB Selective Suspend&quot; -OldValue &quot;Unknown&quot; -NewValue &quot;0&quot;

Write-Host &quot;`n[SUCCESS] USB Selective Suspend disabled.&quot; -ForegroundColor Green
Write-Host &quot;Your USB peripherals will no longer sleep, fixing disconnects and lowering input latency.&quot; -ForegroundColor Yellow



$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Privacy\Disable App Metadata Access.reg">
Windows Registry Editor Version 5.00

; ==============================================================================
; TWEAK: Disable App Metadata Access (Contacts, Calendar, Email, Tasks)
; TARGET SYSTEM: Windows 10 &amp; Windows 11
; DESCRIPTION: Denies application permissions to access sensitive user metadata 
;              keys in the ConsentStore (contacts, appointments, email, userDataTasks).
; SAFETY LEVEL: Safe &amp; Reversible
; ==============================================================================

; --- Contacts ---
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\contacts]
&quot;Value&quot;=&quot;Deny&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\contacts]
&quot;Value&quot;=&quot;Deny&quot;

; --- Calendar (Appointments) ---
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appointments]
&quot;Value&quot;=&quot;Deny&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appointments]
&quot;Value&quot;=&quot;Deny&quot;

; --- Email ---
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\email]
&quot;Value&quot;=&quot;Deny&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\email]
&quot;Value&quot;=&quot;Deny&quot;

; --- Tasks (UserDataTasks) ---
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userDataTasks]
&quot;Value&quot;=&quot;Deny&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userDataTasks]
&quot;Value&quot;=&quot;Deny&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Privacy\Disable Camera.reg">
Windows Registry Editor Version 5.00

; ==============================================================================
; TWEAK: Disable Camera Access
; TARGET SYSTEM: Windows 10 &amp; Windows 11
; DESCRIPTION: Denies application permissions to access the system webcam/camera.
; SAFETY LEVEL: Safe &amp; Reversible
; ==============================================================================

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam]
&quot;Value&quot;=&quot;Deny&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam]
&quot;Value&quot;=&quot;Deny&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Privacy\Disable Location.reg">
Windows Registry Editor Version 5.00

; ==============================================================================
; TWEAK: Disable Location Tracking Access
; TARGET SYSTEM: Windows 10 &amp; Windows 11
; DESCRIPTION: Denies application permissions to access system location data.
; SAFETY LEVEL: Safe &amp; Reversible
; ==============================================================================

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location]
&quot;Value&quot;=&quot;Deny&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location]
&quot;Value&quot;=&quot;Deny&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Privacy\Disable Microphone.reg">
Windows Registry Editor Version 5.00

; ==============================================================================
; TWEAK: Disable Microphone Access
; TARGET SYSTEM: Windows 10 &amp; Windows 11
; DESCRIPTION: Denies application permissions to access system microphone/audio input.
; SAFETY LEVEL: Safe &amp; Reversible
; ==============================================================================

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone]
&quot;Value&quot;=&quot;Deny&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone]
&quot;Value&quot;=&quot;Deny&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Privacy\Disable Notifications.reg">
Windows Registry Editor Version 5.00

; ==============================================================================
; TWEAK: Disable Notification Access
; TARGET SYSTEM: Windows 10 &amp; Windows 11
; DESCRIPTION: Denies application permissions to listen or intercept system 
;              notifications (reduces notification listener background activity).
; SAFETY LEVEL: Safe &amp; Reversible
; ==============================================================================

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userNotificationListener]
&quot;Value&quot;=&quot;Deny&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userNotificationListener]
&quot;Value&quot;=&quot;Deny&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Profiles\Apply_Gaming_Master_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Gaming Master Profile (Tweaks/Profiles/Apply_Gaming_Master_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY GAMING MASTER PROFILE&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile is designed for MAXIMUM GAMING PERFORMANCE.&quot;
Write-Host &quot;It will:&quot;
Write-Host &quot;- Enable Ultimate Performance Power Plan and Game Mode&quot;
Write-Host &quot;- Enable Hardware Accelerated GPU Scheduling&quot;
Write-Host &quot;- Disable visual animations for maximum responsiveness&quot;
Write-Host &quot;- Disable heavy background telemetry and services&quot;
Write-Host &quot;- Disable Windows Update driver downloads&quot;
if (-not $Force) {
    Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
    if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }
    if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Profiles&quot; -Action &quot;Aborted Gaming Master Profile Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
        Exit
    }
}

Write-FrameworkLog -ModuleName &quot;Profiles&quot; -Action &quot;Starting Gaming Master Profile Deployment&quot; -Level WARNING
$TweaksDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Tweaks&quot;

# 1. Power
Write-Host &quot;`n[1/6] Applying Power Optimizations...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Power\Enable_Ultimate_Performance_Plan.ps1&quot;) -Force:$Force
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Power\Disable_USB_Selective_Suspend.ps1&quot;) -Force:$Force

# 2. GPU
Write-Host &quot;`n[2/6] Applying GPU Optimizations...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;GPU\Apply_Gaming_GPU_Profile.ps1&quot;) -Force:$Force

# 3. Visuals
Write-Host &quot;`n[3/6] Applying Visual Optimizations...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Visual\Apply_Max_Performance_Profile.ps1&quot;) -Force:$Force

# 4. Telemetry &amp; Services
Write-Host &quot;`n[4/6] Disabling Heavy Telemetry &amp; Background Tasks...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Services\Apply_Clean_Services_Profile.ps1&quot;) -Force:$Force
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Tasks\Apply_Clean_Tasks_Profile.ps1&quot;) -Force:$Force

# 5. Updates Control
Write-Host &quot;`n[5/6] Disabling Driver Updates &amp; Delivery Optimization...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Updates\Apply_Update_Control_Profile.ps1&quot;) -Force:$Force

# 6. Search
Write-Host &quot;`n[6/6] Disabling Web Search in Start Menu...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Search\Disable_Web_Search.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Profiles&quot; -Action &quot;Completed Gaming Master Profile Deployment&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Gaming Master Profile deployment complete!&quot; -ForegroundColor Green
Write-Host &quot;Please RESTART YOUR COMPUTER for all changes to take effect.&quot; -ForegroundColor Yellow
if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Profiles\Apply_Privacy_Master_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Privacy Master Profile (Tweaks/Profiles/Apply_Privacy_Master_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY MAXIMUM PRIVACY MASTER PROFILE&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile is designed for MAXIMUM DATA PROTECTION.&quot;
Write-Host &quot;It will:&quot;
Write-Host &quot;- Disable all OS-level Diagnostic Data &amp; Telemetry&quot;
Write-Host &quot;- Disable Telemetry Scheduled Tasks and Services&quot;
Write-Host &quot;- Disable Cloud Clipboard and Sync&quot;
Write-Host &quot;- Disable Settings Sync &amp; Activity History&quot;
Write-Host &quot;- Disable Lock Screen &amp; App Camera Access&quot;
Write-Host &quot;- Remove Sponsored Apps (Debloat)&quot;
if (-not $Force) {
    Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
    if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }
    if ($Confirm -notmatch &apos;y&apos;) {
        Write-FrameworkLog -ModuleName &quot;Profiles&quot; -Action &quot;Aborted Privacy Master Profile Deployment&quot;
        Write-Host &quot;`nAborted by user.&quot;
        Exit
    }
}

Write-FrameworkLog -ModuleName &quot;Profiles&quot; -Action &quot;Starting Privacy Master Profile Deployment&quot; -Level WARNING
$TweaksDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Tweaks&quot;

# 1. Core Diagnostics
Write-Host &quot;`n[1/6] Disabling OS Diagnostic Data &amp; Ads...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Diagnostics\Apply_Diagnostics_Privacy_Profile.ps1&quot;) -Force:$Force

# 2. Services &amp; Tasks
Write-Host &quot;`n[2/6] Disabling Telemetry Background Tasks &amp; Services...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Services\Apply_Clean_Services_Profile.ps1&quot;) -Force:$Force
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Tasks\Apply_Clean_Tasks_Profile.ps1&quot;) -Force:$Force

# 3. Data Sync
Write-Host &quot;`n[3/6] Disabling Cloud Sync &amp; Activity History...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Sync\Apply_Privacy_Sync_Profile.ps1&quot;) -Force:$Force

# 4. Clipboard
Write-Host &quot;`n[4/6] Disabling Cloud Clipboard...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Clipboard\Apply_Privacy_Clipboard_Profile.ps1&quot;) -Force:$Force

# 5. Hardware Privacy
Write-Host &quot;`n[5/6] Restricting Camera Access...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Camera\Apply_Privacy_Camera_Profile.ps1&quot;) -Force:$Force

# 6. Apps Debloat
Write-Host &quot;`n[6/6] Removing Sponsored Bloatware...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Apps\Remove_Sponsored_Apps.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Profiles&quot; -Action &quot;Completed Privacy Master Profile Deployment&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Maximum Privacy Master Profile deployment complete!&quot; -ForegroundColor Green
Write-Host &quot;Please RESTART YOUR COMPUTER for all changes to take effect.&quot; -ForegroundColor Yellow
if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Profiles\Apply_Workstation_Master_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Workstation Master Profile (Tweaks/Profiles/Apply_Workstation_Master_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY WORKSTATION MASTER PROFILE&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile is designed for PRODUCTIVITY AND STABILITY.&quot;
Write-Host &quot;It will:&quot;
Write-Host &quot;- Apply the Productivity Explorer Layout&quot;
Write-Host &quot;- Apply Balanced Aesthetic Visuals&quot;
Write-Host &quot;- Disable heavy background telemetry and tracking&quot;
Write-Host &quot;- Disable web search in the Start Menu for faster local searches&quot;
Write-Host &quot;- Keep power settings balanced and driver updates enabled for stability&quot;
if (-not $Force) {
    Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
    if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }
    if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Profiles&quot; -Action &quot;Aborted Workstation Master Profile Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
        Exit
    }
}

Write-FrameworkLog -ModuleName &quot;Profiles&quot; -Action &quot;Starting Workstation Master Profile Deployment&quot; -Level WARNING
$TweaksDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Tweaks&quot;

# 1. Explorer
Write-Host &quot;`n[1/4] Applying Productivity Explorer Layout...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Explorer\Apply_Productivity_Explorer.ps1&quot;) -Force:$Force

# 2. Visuals
Write-Host &quot;`n[2/4] Applying Balanced Aesthetic Visuals...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Visual\Apply_Balanced_Aesthetic_Profile.ps1&quot;) -Force:$Force

# 3. Telemetry &amp; Services
Write-Host &quot;`n[3/4] Disabling Heavy Telemetry &amp; Background Tasks...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Services\Apply_Clean_Services_Profile.ps1&quot;) -Force:$Force
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Tasks\Apply_Clean_Tasks_Profile.ps1&quot;) -Force:$Force

# 4. Search
Write-Host &quot;`n[4/4] Disabling Web Search in Start Menu...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $TweaksDir -ChildPath &quot;Search\Disable_Web_Search.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Profiles&quot; -Action &quot;Completed Workstation Master Profile Deployment&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Workstation Master Profile deployment complete!&quot; -ForegroundColor Green
Write-Host &quot;Please RESTART YOUR COMPUTER for all changes to take effect.&quot; -ForegroundColor Yellow
if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Recursos\CPU Power Plan\Aplicar.bat">
@echo off
title Optimizar PC

:: BatchGotAdmin
REM  --&gt; Check for permissions
    IF &quot;%PROCESSOR_ARCHITECTURE%&quot; EQU &quot;amd64&quot; (
&gt;nul 2&gt;&amp;1 &quot;%SYSTEMROOT%\SysWOW64\cacls.exe&quot; &quot;%SYSTEMROOT%\SysWOW64\config\system&quot;
) ELSE (
&gt;nul 2&gt;&amp;1 &quot;%SYSTEMROOT%\system32\cacls.exe&quot; &quot;%SYSTEMROOT%\system32\config\system&quot;
)

REM --&gt; If error flag set, we do not have admin.
if &apos;%errorlevel%&apos; NEQ &apos;0&apos; (
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^(&quot;Shell.Application&quot;^) &gt; &quot;%temp%\getadmin.vbs&quot;
    set params= %*
    echo UAC.ShellExecute &quot;cmd.exe&quot;, &quot;/c &quot;&quot;%~s0&quot;&quot; %params:&quot;=&quot;&quot;%&quot;, &quot;&quot;, &quot;runas&quot;, 1 &gt;&gt; &quot;%temp%\getadmin.vbs&quot;

    cscript //nologo &quot;%temp%\getadmin.vbs&quot;
    del &quot;%temp%\getadmin.vbs&quot;
    exit /B

:gotAdmin
    pushd &quot;%CD%&quot;
    CD /D &quot;%~dp0&quot;

powercfg -h off
powercfg -import &quot;%~dp0\QuickCPU.pow&quot; a11a11c9-6d83-493e-a38d-d5fa3c620915
powercfg /setactive a11a11c9-6d83-493e-a38d-d5fa3c620915

timeout /t 3 /nobreak
    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Recursos\CPU Priority\Games Priority.reg">
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\3DMark06.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\3DMark05.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\3DMark03.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\PCMark05.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\DriverParallelLines.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\polybridge.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\funkin.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\psxfin.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Sam2.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FEAR.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FFXiWinBench.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\WoW.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\RelicCOH.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\age3.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\BF2.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\BF2142.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\cod2sp_s.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\cod2mp_s.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\dreamfall.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\MAINAPP.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\fsx.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ArmyOps.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\SPLINTERCELL3.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\CoDSP.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\CoDUOSP.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FarCry.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FEARXP.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\GRAW.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\H5_GAME.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FIFA09.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\hl2.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\hl.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\hitman2.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\HitmanContracts.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\MaxPayne2.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\nfsMW.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Lockdown.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\SniperElite.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Swat4.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Swat4X.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\KOTT2.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FA.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\LChAp2008.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\PES6.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\pcsx2.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\pes2009.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\VT3.EXE\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\csgo.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\cs2.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FortniteClient-Win64-Shipping.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\gta3.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\gta_vc.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\gta_sa.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\GTAIV.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\GTA5.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\java.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\javaw.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\minecraft.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Minecraft.Windows.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\obs32.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\obs64.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\OptiCraft.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\pes6.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\pes13.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\pes17.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\cyberpunk2077.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ACValhalla.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Warzone.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FIFA22.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\re8.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\hitman3.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\outriders.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\MELE.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FarCry6.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Battlefield2042.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\DOOMEternalx64vk.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\RDR2.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\MetroExodus.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\HorizonZeroDawn.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\DyingLight2.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\CODVanguard.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Diablo4.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Starfield.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\EldenRing.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Sekiro.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Ghostrunner.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ResidentEvil3.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\PES2022.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Hitman2.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Deathloop.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\WatchDogsLegion.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Minecraft.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\RatchetAndClank.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\DemonSouls.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FinalFantasyVII.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\HogwartsLegacy.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Battlefield6.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\StarCitizen.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\TheWitcher4.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Borderlands4.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Sims5.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ElderScrolls6.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Overwatch2.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\RainbowSixQuarantine.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\GTA6.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ForzaHorizon5.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\HaloInfinite.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\StarWarsJediFallenOrder2.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Bioshock4.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Wolfenstein3.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\EvilWithin3.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\DeusEx4.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\MetroLastLight.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\PPSSPP.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\PCSX2.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000006

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Recursos\CPU Priority\Windows Priority.reg">
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\lsass.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000005

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\MsMpEng.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ShellExperienceHost.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000005

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\smss.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000005

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\winlogon.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000005

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\explorer.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000005

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\cmd.exe\PerfOptions]
&quot;CpuPriorityClass&quot;=dword:00000005
    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Recursos\Optimize SSD\Optimizar SSD.reg">
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager]
&quot;DisablePagingExecutive&quot;=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]
&quot;DisablePagingExecutive&quot;=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters]
&quot;EnablePrefetcher&quot;=dword:00000000
&quot;EnableSuperfetch&quot;=dword:00000000
&quot;EnableBoottrace&quot;=dword:00000000
    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Recursos\RAM Compression\Disable Compression.cmd">
@echo off

:: BatchGotAdmin
REM  --&gt; Check for permissions
    IF &quot;%PROCESSOR_ARCHITECTURE%&quot; EQU &quot;amd64&quot; (
&gt;nul 2&gt;&amp;1 &quot;%SYSTEMROOT%\SysWOW64\cacls.exe&quot; &quot;%SYSTEMROOT%\SysWOW64\config\system&quot;
) ELSE (
&gt;nul 2&gt;&amp;1 &quot;%SYSTEMROOT%\system32\cacls.exe&quot; &quot;%SYSTEMROOT%\system32\config\system&quot;
)

REM --&gt; If error flag set, we do not have admin.
if &apos;%errorlevel%&apos; NEQ &apos;0&apos; (
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^(&quot;Shell.Application&quot;^) &gt; &quot;%temp%\getadmin.vbs&quot;
    set params= %*
    echo UAC.ShellExecute &quot;cmd.exe&quot;, &quot;/c &quot;&quot;%~s0&quot;&quot; %params:&quot;=&quot;&quot;%&quot;, &quot;&quot;, &quot;runas&quot;, 1 &gt;&gt; &quot;%temp%\getadmin.vbs&quot;

    cscript //nologo &quot;%temp%\getadmin.vbs&quot;
    del &quot;%temp%\getadmin.vbs&quot;
    exit /B

:gotAdmin
    pushd &quot;%CD%&quot;
    CD /D &quot;%~dp0&quot;

powershell &quot;Disable-MMAgent -MemoryCompression&quot;
timeout /t 3 /nobreak
    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Recursos\Services\Optimize Services.ps1">
# ========================================================================
#                  WinAurex - OPTIMIZE SERVICES TWEAK
# ========================================================================
# Enforces service states via Service Control Manager (SCM) to bypass
# strict registry key ACLs and permissions issues.
# ========================================================================

# Check for Administrator privileges
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script must be run as Administrator! Please relaunch an elevated console.&quot;
    Exit
}

$services = @{
    &quot;WbioSrvc&quot;         = &quot;Disabled&quot;
    &quot;FontCache&quot;        = &quot;Disabled&quot;
    &quot;FontCache3.0.0.0&quot; = &quot;Disabled&quot;
    &quot;GraphicsPerfSvc&quot;  = &quot;Disabled&quot;
    &quot;stisvc&quot;           = &quot;Disabled&quot;
    &quot;WerSvc&quot;           = &quot;Disabled&quot;
    &quot;PcaSvc&quot;           = &quot;Disabled&quot;
    &quot;Wecsvc&quot;           = &quot;Disabled&quot;
    &quot;DiagTrack&quot;        = &quot;Disabled&quot;
    &quot;GpuEnergyDrv&quot;     = &quot;Disabled&quot;
    &quot;WSearch&quot;          = &quot;Disabled&quot;
    &quot;ShellHWDetection&quot; = &quot;Disabled&quot;
    &quot;ssh-agent&quot;        = &quot;Disabled&quot;
    &quot;diagsvc&quot;          = &quot;Disabled&quot;
    &quot;DPS&quot;              = &quot;Disabled&quot;
}

Write-Output &quot;========================================================================&quot;
Write-Output &quot;                  APPLYING SERVICES OPTIMIZATION&quot;
Write-Output &quot;========================================================================&quot;

foreach ($service in $services.Keys) {
    if (Get-Service -Name $service -ErrorAction SilentlyContinue) {
        Write-Host &quot;Configuring: [ $service ] -&gt; $($services[$service])&quot; -ForegroundColor Cyan
        Stop-Service -Name $service -Force -ErrorAction SilentlyContinue
        Set-Service -Name $service -StartupType $services[$service] -ErrorAction SilentlyContinue
    } else {
        Write-Host &quot;Configuring: [ $service ] -&gt; NOT DETECTED (Skipping)&quot; -ForegroundColor Yellow
    }
}

Write-Output &quot;========================================================================&quot;
Write-Output &quot;                     SERVICES OPTIMIZATION APPLIED&quot;
Write-Output &quot;========================================================================&quot;

Read-Host -Prompt &quot;Press Enter to exit&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Recursos\Services\Optimize Services.reg">
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WbioSrvc]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FontCache]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FontCache3.0.0.0]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\GraphicsPerfSvc]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\stisvc]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WerSvc]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PcaSvc]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Wecsvc]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DiagTrack]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\GpuEnergyDrv]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WSearch]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ShellHWDetection]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ssh-agent]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\diagsvc]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DPS]
&quot;Start&quot;=dword:00000004
    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Recursos\Telemetry\Disable Telemetry.reg">
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DiagTrack]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dmwappushservice]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\diagsvc]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DPS]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\diagnosticshub.standardcollector.service]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdiServiceHost]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdiSystemHost]
&quot;Start&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppCompat]
&quot;AITEnable&quot;=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection]
&quot;AllowTelemetry&quot;=dword:00000000

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\vortex.data.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\vortex-win.data.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\telecommand.telemetry.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\telecommand.telemetry.microsoft.com.nsatc.net]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\oca.telemetry.microsoft.com.nsatc.net]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\sqm.telemetry.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\sqm.telemetry.microsoft.com.nsatc.net]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\watson.telemetry.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\watson.telemetry.microsoft.com.nsatc.net]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\redir.metaservices.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\choice.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\choice.microsoft.com.nsatc.net]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\df.telemetry.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\reports.wes.df.telemetry.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\wes.df.telemetry.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\services.wes.df.telemetry.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\sqm.df.telemetry.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\telemetry.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\watson.ppe.telemetry.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\telemetry.appex.bing.net]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\telemetry.urs.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\settings-sandbox.data.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\vortex-sandbox.data.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\survey.watson.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\watson.live.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\watson.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\statsfe2.ws.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\corpext.msitadfs.glbdns2.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\compatexchange.cloudapp.net]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\cs1.wpc.v0cdn.net]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\a-0001.a-msedge.net]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\statsfe2.update.microsoft.com.akadns.net]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\sls.update.microsoft.com.akadns.net]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\fe2.update.microsoft.com.akadns.net]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\diagnostics.support.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\corp.sts.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\statsfe1.ws.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\pre.footprintpredict.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\i1.services.social.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\i1.services.social.microsoft.com.nsatc.net]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\feedback.windows.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\feedback.microsoft-hohm.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\feedback.search.microsoft.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\rad.msn.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\preview.msn.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\ad.doubleclick.net]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\ads.msn.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\ads1.msads.net]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\ads1.msn.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\a.ads1.msn.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\a.ads2.msn.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\adnexus.net]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\adnxs.com]
&quot;*&quot;=dword:00000004

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\az361816.vo.msecnd.net]
&quot;*&quot;=dword:00000004
    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Resources\Delete Temporary Files.bat">
@echo off

:: BatchGotAdmin
REM  --&gt; Check for permissions
    IF &quot;%PROCESSOR_ARCHITECTURE%&quot; EQU &quot;amd64&quot; (
&gt;nul 2&gt;&amp;1 &quot;%SYSTEMROOT%\SysWOW64\cacls.exe&quot; &quot;%SYSTEMROOT%\SysWOW64\config\system&quot;
) ELSE (
&gt;nul 2&gt;&amp;1 &quot;%SYSTEMROOT%\system32\cacls.exe&quot; &quot;%SYSTEMROOT%\system32\config\system&quot;
)

REM --&gt; If error flag set, we do not have admin.
if &apos;%errorlevel%&apos; NEQ &apos;0&apos; (
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^(&quot;Shell.Application&quot;^) &gt; &quot;%temp%\getadmin.vbs&quot;
    set params= %*
    echo UAC.ShellExecute &quot;cmd.exe&quot;, &quot;/c &quot;&quot;%~s0&quot;&quot; %params:&quot;=&quot;&quot;&quot;%&quot;, &quot;&quot;, &quot;runas&quot;, 1 &gt;&gt; &quot;%temp%\getadmin.vbs&quot;

    cscript //nologo &quot;%temp%\getadmin.vbs&quot;
    del &quot;%temp%\getadmin.vbs&quot;
    exit /B

:gotAdmin
    pushd &quot;%CD%&quot;
    CD /D &quot;%~dp0&quot; 

del /S /F /Q &quot;%temp%&quot;
del /S /F /Q &quot;%WINDIR%\Temp\*.*&quot;
del /S /F /Q &quot;%WINDIR%\Prefetch\*.*&quot;
del /S /F /Q &quot;%WINDIR%\logs\cbs\*.log&quot;
del /S /F /Q &quot;%WINDIR%\Logs\MoSetup\*.log&quot;
del /S /F /Q &quot;%WINDIR%\Panther\*.log&quot;
del /S /F /Q &quot;%WINDIR%\inf\*.log&quot;
del /S /F /Q &quot;%WINDIR%\logs\*.log&quot;
del /S /F /Q &quot;%WINDIR%\SoftwareDistribution\*.log&quot;
del /S /F /Q &quot;%WINDIR%\Microsoft.NET\*.log&quot;
del /S /F /Q &quot;%SystemDrive%\Users\%USERNAME%\AppData\Local\Microsoft\Windows\WebCache\*.log&quot;
del /S /F /Q &quot;%SystemDrive%\Users\%USERNAME%\AppData\Local\Microsoft\Windows\SettingSync\*.log&quot;
del /S /F /Q &quot;%SystemDrive%\Users\%USERNAME%\AppData\Local\Microsoft\Windows\Explorer\ThumbCacheToDelete\*.tmp&quot;
del /S /F /Q &quot;%SystemDrive%\Users\%USERNAME%\AppData\Local\Microsoft\Terminal Server Client\Cache\*.bin&quot;
net stop wuauserv
net stop UsoSvc
del /S /F /Q &quot;%WINDIR%\SoftwareDistribution&quot;
timeout /t 5 /nobreak

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Resources\CPU Power Plan\Apply.bat">
@echo off
title Optimize PC

:: BatchGotAdmin
REM  --&gt; Check for permissions
    IF &quot;%PROCESSOR_ARCHITECTURE%&quot; EQU &quot;amd64&quot; (
&gt;nul 2&gt;&amp;1 &quot;%SYSTEMROOT%\SysWOW64\cacls.exe&quot; &quot;%SYSTEMROOT%\SysWOW64\config\system&quot;
) ELSE (
&gt;nul 2&gt;&amp;1 &quot;%SYSTEMROOT%\system32\cacls.exe&quot; &quot;%SYSTEMROOT%\system32\config\system&quot;
)

REM --&gt; If error flag set, we do not have admin.
if &apos;%errorlevel%&apos; NEQ &apos;0&apos; (
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^(&quot;Shell.Application&quot;^) &gt; &quot;%temp%\getadmin.vbs&quot;
    set params= %*
    echo UAC.ShellExecute &quot;cmd.exe&quot;, &quot;/c &quot;&quot;%~s0&quot;&quot; %params:&quot;=&quot;&quot;&quot;%&quot;, &quot;&quot;, &quot;runas&quot;, 1 &gt;&gt; &quot;%temp%\getadmin.vbs&quot;

    cscript //nologo &quot;%temp%\getadmin.vbs&quot;
    del &quot;%temp%\getadmin.vbs&quot;
    exit /B

:gotAdmin
    pushd &quot;%CD%&quot;
    CD /D &quot;%~dp0&quot;

powercfg -h off
if exist &quot;%~dp0\QuickCPU.pow&quot; (
    powercfg -import &quot;%~dp0\QuickCPU.pow&quot; a11a11c9-6d83-493e-a38d-d5fa3c620915
    powercfg /setactive a11a11c9-6d83-493e-a38d-d5fa3c620915
    echo Power plan imported and activated.
) else (
    echo [ERROR] QuickCPU.pow not found in %~dp0
    echo Skipping power plan import.
)

timeout /t 3 /nobreak

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Resources\RAM Compression\Disable Compression.cmd">
@echo off

:: BatchGotAdmin
REM  --&gt; Check for permissions
    IF &quot;%PROCESSOR_ARCHITECTURE%&quot; EQU &quot;amd64&quot; (
&gt;nul 2&gt;&amp;1 &quot;%SYSTEMROOT%\SysWOW64\cacls.exe&quot; &quot;%SYSTEMROOT%\SysWOW64\config\system&quot;
) ELSE (
&gt;nul 2&gt;&amp;1 &quot;%SYSTEMROOT%\system32\cacls.exe&quot; &quot;%SYSTEMROOT%\system32\config\system&quot;
)

REM --&gt; If error flag set, we do not have admin.
if &apos;%errorlevel%&apos; NEQ &apos;0&apos; (
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^(&quot;Shell.Application&quot;^) &gt; &quot;%temp%\getadmin.vbs&quot;
    set params= %*
    echo UAC.ShellExecute &quot;cmd.exe&quot;, &quot;/c &quot;&quot;%~s0&quot;&quot; %params:&quot;=&quot;&quot;&quot;%&quot;, &quot;&quot;, &quot;runas&quot;, 1 &gt;&gt; &quot;%temp%\getadmin.vbs&quot;

    cscript //nologo &quot;%temp%\getadmin.vbs&quot;
    del &quot;%temp%\getadmin.vbs&quot;
    exit /B

:gotAdmin
    pushd &quot;%CD%&quot;
    CD /D &quot;%~dp0&quot;

powershell &quot;Disable-MMAgent -MemoryCompression&quot;
timeout /t 3 /nobreak

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Search\Apply_Privacy_Search_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Privacy Search Profile (Tweaks/Search/Apply_Privacy_Search_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY PRIVACY SEARCH PROFILE&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile locks down Windows Search to strictly local files and apps.&quot;
Write-Host &quot;It disables Bing web results, dynamic search highlights, and local search history.&quot;
Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Search&quot; -Action &quot;Aborted Privacy Search Profile Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Search&quot; -Action &quot;Starting Master Privacy Search Orchestrator&quot; -Level WARNING

$ScriptDir = $PSScriptRoot

Write-Host &quot;`n[1/3] Disabling Web Search (Bing) integration...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Web_Search.ps1&quot;) -Force:$Force

Write-Host &quot;`n[2/3] Disabling Dynamic Search Highlights...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Search_Highlights.ps1&quot;) -Force:$Force

Write-Host &quot;`n[3/3] Disabling Local Search History tracking...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Local_Search_History.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Search&quot; -Action &quot;Completed Master Privacy Search Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Privacy Search Profile deployment complete!&quot; -ForegroundColor Green
Write-Host &quot;Restarting Windows Explorer to apply search UI changes immediately...&quot; -ForegroundColor Yellow
Stop-Process -Name &quot;explorer&quot; -Force

if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Search\Disable_Local_Search_History.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Local Search History (Tweaks/Search/Disable_Local_Search_History.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Search&quot; -Action &quot;Initiating Local Search History Disablement&quot;

$RegistryPath = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\SearchSettings&quot;
if (-not (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null }

$Name = &quot;SaveSearchHistory&quot;

# 1. Snapshot current state
$CurrentValue = (Get-ItemProperty -Path $RegistryPath -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentValue) { $CurrentValue = &quot;Not_Set&quot; }

# 2. Apply Configuration (0 = Disabled, 1 = Enabled)
Set-ItemProperty -Path $RegistryPath -Name $Name -Value 0 -Type DWord -Force

# 3. Log Outcome
Write-FrameworkLog -ModuleName &quot;Search&quot; -Action &quot;Disabled Local Search History&quot; -OldValue $CurrentValue -NewValue &quot;0&quot;

Write-Host &quot;`n[SUCCESS] Local device search history has been disabled.&quot; -ForegroundColor Green


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Search\Disable_Web_Search.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Web Search in Start Menu (Tweaks/Search/Disable_Web_Search.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Search&quot; -Action &quot;Initiating Web Search Disablement&quot;

# 1. Disable Bing Search Integration
$RegPathBing = &quot;HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search&quot;
if (-not (Test-Path $RegPathBing)) { New-Item -Path $RegPathBing -Force | Out-Null }

$CurrentBing = (Get-ItemProperty -Path $RegPathBing -Name &quot;BingSearchEnabled&quot; -ErrorAction SilentlyContinue).BingSearchEnabled
if ($null -eq $CurrentBing) { $CurrentBing = &quot;Not_Set&quot; }

Set-ItemProperty -Path $RegPathBing -Name &quot;BingSearchEnabled&quot; -Value 0 -Type DWord -Force
Write-FrameworkLog -ModuleName &quot;Search&quot; -Action &quot;Disabled Bing Search&quot; -OldValue $CurrentBing -NewValue &quot;0&quot;

# 2. Disable Search Box Web Suggestions (Policies)
$RegPathPolicy = &quot;HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer&quot;
if (-not (Test-Path $RegPathPolicy)) { New-Item -Path $RegPathPolicy -Force | Out-Null }

$CurrentPolicy = (Get-ItemProperty -Path $RegPathPolicy -Name &quot;DisableSearchBoxSuggestions&quot; -ErrorAction SilentlyContinue).DisableSearchBoxSuggestions
if ($null -eq $CurrentPolicy) { $CurrentPolicy = &quot;Not_Set&quot; }

Set-ItemProperty -Path $RegPathPolicy -Name &quot;DisableSearchBoxSuggestions&quot; -Value 1 -Type DWord -Force
Write-FrameworkLog -ModuleName &quot;Search&quot; -Action &quot;Disabled Search Box Web Suggestions&quot; -OldValue $CurrentPolicy -NewValue &quot;1&quot;

Write-Host &quot;`n[SUCCESS] Web search and Bing integration in the Start Menu has been disabled.&quot; -ForegroundColor Green
Write-Host &quot;Local file and app search will now be much faster and strictly private.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Search\Rebuild_Search_Index.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Rebuild Search Index (Tweaks/Search/Rebuild_Search_Index.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   REBUILD WINDOWS SEARCH INDEX&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;WARNING: Rebuilding the search index will cause a temporary CPU and Disk I/O spike.&quot;
Write-Host &quot;Search results will be incomplete until the rebuild finishes (usually 15-60 minutes).&quot;
Write-Host &quot;It is highly recommended to do this when the PC is idle.&quot;
Write-Host &quot;Press &apos;Y&apos; to initiate rebuild, or any other key to abort...&quot; -ForegroundColor Yellow
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Search&quot; -Action &quot;Aborted Search Index Rebuild&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Search&quot; -Action &quot;Initiating Search Index Rebuild&quot; -Level WARNING

$RegistryPath = &quot;HKLM:\SOFTWARE\Microsoft\Windows Search&quot;
$Name = &quot;SetupCompletedSuccessfully&quot;

# 1. Snapshot current state
$CurrentValue = (Get-ItemProperty -Path $RegistryPath -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentValue) { $CurrentValue = &quot;Not_Set&quot; }

# 2. Trigger Rebuild (Set to 0 and restart service)
Set-ItemProperty -Path $RegistryPath -Name $Name -Value 0 -Type DWord -Force

Write-Host &quot;`nRestarting Windows Search Service (WSearch)...&quot;
Restart-Service -Name &quot;WSearch&quot; -Force -ErrorAction SilentlyContinue

# 3. Log Outcome
Write-FrameworkLog -ModuleName &quot;Search&quot; -Action &quot;Triggered Windows Search Index Rebuild&quot; -OldValue $CurrentValue -NewValue &quot;0&quot;

Write-Host &quot;`n[SUCCESS] Search Index rebuild has been initiated in the background.&quot; -ForegroundColor Green
Write-Host &quot;You can monitor the status in &apos;Indexing Options&apos; in the Control Panel.&quot;


$null = Read-Host &quot;Press Enter to exit...&quot;


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Security\Configure_SmartScreen.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Configure SmartScreen (Tweaks/Security/Configure_SmartScreen.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force
$SnapshotDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Restore&quot;

Write-Host &quot;=================================================&quot;
Write-Host &quot;   CONFIGURE DEFENDER SMARTSCREEN&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;SmartScreen protects against malicious apps and sites,&quot;
Write-Host &quot;but can flag unsigned independent developer tools.&quot;
Write-Host &quot;1. Enable SmartScreen (Recommended for Security)&quot;
Write-Host &quot;2. Disable SmartScreen (For Developers/Power Users)&quot;
Write-Host &quot;3. Abort&quot;
Write-Host &quot;=================================================&quot;
$Choice = Read-Host &quot;Select an option [1-3]&quot;

if ($Choice -notmatch &apos;^[1-2]$&apos;) {
    Write-FrameworkLog -ModuleName &quot;Security&quot; -Action &quot;Aborted SmartScreen config&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Security&quot; -Action &quot;Backing up SmartScreen registry keys&quot;
$RegPath1 = &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\System&quot;
$RegPath2 = &quot;HKCU\Software\Microsoft\Windows\CurrentVersion\AppHost&quot;
$BackupFile = Join-Path -Path $SnapshotDir -ChildPath &quot;SmartScreen_Backup_$(Get-Date -Format &apos;yyyyMMdd_HHmmss&apos;).reg&quot;
&amp; reg export $RegPath1 $BackupFile /y | Out-Null
&amp; reg export $RegPath2 $BackupFile /y | Out-Null

$SysKey = &quot;HKLM:\SOFTWARE\Policies\Microsoft\Windows\System&quot;
$AppKey = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\AppHost&quot;

if (-not (Test-Path $SysKey)) { New-Item -Path $SysKey -Force | Out-Null }
if (-not (Test-Path $AppKey)) { New-Item -Path $AppKey -Force | Out-Null }

if ($Choice -eq &apos;1&apos;) {
    Write-Host &quot;`nEnabling SmartScreen...&quot; -ForegroundColor Yellow
    Set-ItemProperty -Path $SysKey -Name &quot;EnableSmartScreen&quot; -Value 1 -Type DWord -Force
    Set-ItemProperty -Path $AppKey -Name &quot;EnableWebContentEvaluation&quot; -Value 1 -Type DWord -Force
    Write-FrameworkLog -ModuleName &quot;Security&quot; -Action &quot;Enabled SmartScreen&quot;
    Write-Host &quot;[SUCCESS] SmartScreen is ENABLED.&quot; -ForegroundColor Green
} else {
    Write-Host &quot;`nDisabling SmartScreen...&quot; -ForegroundColor Yellow
    Set-ItemProperty -Path $SysKey -Name &quot;EnableSmartScreen&quot; -Value 0 -Type DWord -Force
    Set-ItemProperty -Path $AppKey -Name &quot;EnableWebContentEvaluation&quot; -Value 0 -Type DWord -Force
    Write-FrameworkLog -ModuleName &quot;Security&quot; -Action &quot;Disabled SmartScreen&quot; -Level WARNING
    Write-Host &quot;[SUCCESS] SmartScreen is DISABLED.&quot; -ForegroundColor Red
}



$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Security\Firewall_Profile_Manager.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Firewall Profile Manager (Tweaks/Security/Firewall_Profile_Manager.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   FIREWALL PROFILE MANAGER&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;Manage Windows Defender Firewall states across all profiles.&quot;
Write-Host &quot;WARNING: Disabling the firewall exposes your system to&quot;
Write-Host &quot;network attacks. Only disable for specific testing.&quot;
Write-Host &quot;=================================================&quot;
Write-Host &quot;1. Restore Default Firewall State (ON for all profiles)&quot;
Write-Host &quot;2. Disable Firewall entirely (DANGEROUS)&quot;
Write-Host &quot;3. Abort&quot;
Write-Host &quot;=================================================&quot;
$Choice = Read-Host &quot;Select an option [1-3]&quot;

if ($Choice -notmatch &apos;^[1-2]$&apos;) {
    Write-FrameworkLog -ModuleName &quot;Security&quot; -Action &quot;Aborted Firewall config&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

if ($Choice -eq &apos;1&apos;) {
    Write-Host &quot;`nRestoring Firewall defaults...&quot; -ForegroundColor Yellow
    Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled True
    Write-FrameworkLog -ModuleName &quot;Security&quot; -Action &quot;Enabled Windows Firewall across all profiles&quot;
    Write-Host &quot;[SUCCESS] Windows Firewall is now ENABLED for all profiles.&quot; -ForegroundColor Green
} else {
    Write-Host &quot;`nDisabling Windows Firewall...&quot; -ForegroundColor Yellow
    Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
    Write-FrameworkLog -ModuleName &quot;Security&quot; -Action &quot;Disabled Windows Firewall&quot; -Level WARNING
    Write-Host &quot;[WARNING] Windows Firewall is now DISABLED. Your system is vulnerable.&quot; -ForegroundColor Red
}



$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Security\Memory_Integrity_Manager.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Memory Integrity Manager (Tweaks/Security/Memory_Integrity_Manager.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force
$SnapshotDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Restore&quot;

Write-Host &quot;=================================================&quot;
Write-Host &quot;   MEMORY INTEGRITY (HVCI) MANAGER&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;Memory Integrity uses hardware virtualization to prevent&quot;
Write-Host &quot;malicious code from injecting into the kernel.&quot;
Write-Host &quot;&quot;
Write-Host &quot;[Trade-off] High Security vs. Slight Gaming/VM Overhead&quot;
Write-Host &quot;=================================================&quot;
Write-Host &quot;1. Enable Memory Integrity (High Security)&quot;
Write-Host &quot;2. Disable Memory Integrity (Max Performance/Legacy Drivers)&quot;
Write-Host &quot;3. Abort&quot;
Write-Host &quot;=================================================&quot;
$Choice = Read-Host &quot;Select an option [1-3]&quot;

if ($Choice -notmatch &apos;^[1-2]$&apos;) {
    Write-FrameworkLog -ModuleName &quot;Security&quot; -Action &quot;Aborted HVCI config&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Security&quot; -Action &quot;Backing up HVCI registry keys&quot;
$RegPath1 = &quot;HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity&quot;
$BackupFile = Join-Path -Path $SnapshotDir -ChildPath &quot;HVCI_Backup_$(Get-Date -Format &apos;yyyyMMdd_HHmmss&apos;).reg&quot;
&amp; reg export $RegPath1 $BackupFile /y | Out-Null

$KeyPath = &quot;HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity&quot;
if (-not (Test-Path $KeyPath)) { New-Item -Path $KeyPath -Force | Out-Null }

if ($Choice -eq &apos;1&apos;) {
    Write-Host &quot;`nEnabling Memory Integrity...&quot; -ForegroundColor Yellow
    Set-ItemProperty -Path $KeyPath -Name &quot;Enabled&quot; -Value 1 -Type DWord -Force
    Write-FrameworkLog -ModuleName &quot;Security&quot; -Action &quot;Enabled HVCI&quot;
    Write-Host &quot;[SUCCESS] Memory Integrity is ENABLED.&quot; -ForegroundColor Green
} else {
    Write-Host &quot;`nDisabling Memory Integrity...&quot; -ForegroundColor Yellow
    Set-ItemProperty -Path $KeyPath -Name &quot;Enabled&quot; -Value 0 -Type DWord -Force
    Write-FrameworkLog -ModuleName &quot;Security&quot; -Action &quot;Disabled HVCI&quot; -Level WARNING
    Write-Host &quot;[SUCCESS] Memory Integrity is DISABLED.&quot; -ForegroundColor Red
}

Write-Host &quot;A SYSTEM REBOOT is required for HVCI changes to take effect.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Services\Apply_Clean_Services_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Clean Services Profile (Tweaks/Services/Apply_Clean_Services_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY CLEAN SERVICES PROFILE&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile disables background telemetry services like DiagTrack.&quot;
Write-Host &quot;It frees up background RAM and stops Windows from transmitting&quot;
Write-Host &quot;diagnostic/usage data to Microsoft servers.&quot;
Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Services&quot; -Action &quot;Aborted Clean Services Profile Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Services&quot; -Action &quot;Starting Master Clean Services Orchestrator&quot; -Level WARNING

$ScriptDir = $PSScriptRoot

Write-Host &quot;`n[1/1] Disabling Telemetry Background Services...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Telemetry_Services.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Services&quot; -Action &quot;Completed Master Clean Services Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Clean Services Profile deployment complete!&quot; -ForegroundColor Green
if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Services\Disable_Telemetry_Services.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Telemetry Services (Tweaks/Services/Disable_Telemetry_Services.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Services&quot; -Action &quot;Initiating Telemetry Services Disablement&quot;

# Array of known heavy telemetry services
$TelemetryServices = @(
    &quot;DiagTrack&quot;,       # Connected User Experiences and Telemetry
    &quot;dmwappushservice&quot; # WAP Push Message Routing
)

$DisabledCount = 0

foreach ($ServiceName in $TelemetryServices) {
    $Service = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue
    
    if ($Service) {
        $CurrentState = $Service.StartType
        
        if ($CurrentState -ne &quot;Disabled&quot;) {
            # Stop the service if running
            if ($Service.Status -eq &quot;Running&quot;) {
                Stop-Service -Name $ServiceName -Force -ErrorAction SilentlyContinue
            }
            
            # Disable startup
            Set-Service -Name $ServiceName -StartupType Disabled -ErrorAction SilentlyContinue
            
            Write-FrameworkLog -ModuleName &quot;Services&quot; -Action &quot;Disabled Service: $ServiceName&quot; -OldValue $CurrentState -NewValue &quot;Disabled&quot;
            $DisabledCount++
        }
    }
}

Write-Host &quot;`n[SUCCESS] Successfully disabled $DisabledCount background telemetry services.&quot; -ForegroundColor Green
Write-Host &quot;This will reduce idle RAM usage and block Microsoft data collection.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Shell\Apply_Minimal_Shell.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Minimal Shell Orchestrator (Tweaks/Shell/Apply_Minimal_Shell.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY MINIMAL SHELL PRESET&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This will disable Copilot, Widgets, Start Menu Recommendations, and Notification Spam.&quot;
Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Shell&quot; -Action &quot;Aborted Minimal Shell Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Shell&quot; -Action &quot;Starting Master Minimal Shell Orchestrator&quot; -Level WARNING

$ScriptDir = $PSScriptRoot

Write-Host &quot;`n[1/4] Disabling Copilot Taskbar Integration...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Copilot_Taskbar.ps1&quot;) -Force:$Force

Write-Host &quot;`n[2/4] Disabling Windows Widgets...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Windows_Widgets.ps1&quot;) -Force:$Force

Write-Host &quot;`n[3/4] Removing Recommended Section from Start Menu...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Remove_Recommended_Section.ps1&quot;) -Force:$Force

Write-Host &quot;`n[4/4] Disabling Notification Spam...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Notification_Spam.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Shell&quot; -Action &quot;Completed Master Minimal Shell Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Minimal Shell deployment complete!&quot; -ForegroundColor Green
Write-Host &quot;Restarting Windows Explorer to apply all visual changes immediately...&quot; -ForegroundColor Yellow
Stop-Process -Name &quot;explorer&quot; -Force

if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Shell\Disable_Copilot_Taskbar.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Windows Copilot Taskbar Integration (Tweaks/Shell/Disable_Copilot_Taskbar.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Shell&quot; -Action &quot;Initiating Copilot Disablement&quot;

$RegistryPath = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced&quot;
$Name = &quot;ShowCopilotButton&quot;

# 1. Snapshot current state for reversibility
$CurrentValue = (Get-ItemProperty -Path $RegistryPath -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentValue) { $CurrentValue = &quot;Not_Set&quot; }

# 2. Apply Configuration (0 = Disabled, 1 = Enabled)
Set-ItemProperty -Path $RegistryPath -Name $Name -Value 0 -Type DWord -Force

# 3. Log Outcome
Write-FrameworkLog -ModuleName &quot;Shell&quot; -Action &quot;Disabled Copilot Button&quot; -OldValue $CurrentValue -NewValue &quot;0&quot;

Write-Host &quot;`n[SUCCESS] Windows Copilot Taskbar Button Disabled.&quot; -ForegroundColor Green
Write-Host &quot;A Windows Explorer restart may be required to see changes immediately.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Shell\Disable_Notification_Spam.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Notification Spam &amp; Windows Tips (Tweaks/Shell/Disable_Notification_Spam.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Shell&quot; -Action &quot;Initiating Notification Spam Cleanup&quot;

$RegistryPath = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot;
$Name = &quot;SubscribedContent-338389Enabled&quot;

# 1. Snapshot current state for reversibility
$CurrentValue = (Get-ItemProperty -Path $RegistryPath -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentValue) { $CurrentValue = &quot;Not_Set&quot; }

# 2. Apply Configuration (0 = Disabled, 1 = Enabled)
Set-ItemProperty -Path $RegistryPath -Name $Name -Value 0 -Type DWord -Force

# 3. Log Outcome
Write-FrameworkLog -ModuleName &quot;Shell&quot; -Action &quot;Disabled Windows Tips &amp; Suggestions&quot; -OldValue $CurrentValue -NewValue &quot;0&quot;

Write-Host &quot;`n[SUCCESS] Windows tips and suggestion notification spam disabled.&quot; -ForegroundColor Green


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Shell\Disable_Windows_Widgets.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Windows Widgets (Tweaks/Shell/Disable_Windows_Widgets.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Shell&quot; -Action &quot;Initiating Widgets Disablement&quot;

$RegistryPath = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced&quot;
$Name = &quot;TaskbarDa&quot;

# 1. Snapshot current state for reversibility
$CurrentValue = (Get-ItemProperty -Path $RegistryPath -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentValue) { $CurrentValue = &quot;Not_Set&quot; }

# 2. Apply Configuration (0 = Disabled, 1 = Enabled)
Set-ItemProperty -Path $RegistryPath -Name $Name -Value 0 -Type DWord -Force

# 3. Log Outcome
Write-FrameworkLog -ModuleName &quot;Shell&quot; -Action &quot;Disabled Windows Widgets&quot; -OldValue $CurrentValue -NewValue &quot;0&quot;

Write-Host &quot;`n[SUCCESS] Windows Widgets and News Feed Disabled.&quot; -ForegroundColor Green
Write-Host &quot;A Windows Explorer restart may be required to see changes immediately.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Shell\Remove_Recommended_Section.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Remove Start Menu Recommended Section (Tweaks/Shell/Remove_Recommended_Section.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Shell&quot; -Action &quot;Initiating Start Menu Recommended Cleanup&quot;

$RegistryPath = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced&quot;
$Name = &quot;HideRecentJumplists&quot;

# 1. Snapshot current state for reversibility
$CurrentValue = (Get-ItemProperty -Path $RegistryPath -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentValue) { $CurrentValue = &quot;Not_Set&quot; }

# 2. Apply Configuration (1 = Hidden, 0 = Visible)
Set-ItemProperty -Path $RegistryPath -Name $Name -Value 1 -Type DWord -Force

# 3. Log Outcome
Write-FrameworkLog -ModuleName &quot;Shell&quot; -Action &quot;Disabled Recent/Recommended Jumplists&quot; -OldValue $CurrentValue -NewValue &quot;1&quot;

Write-Host &quot;`n[SUCCESS] Start Menu Recommended section and Jump Lists cleared.&quot; -ForegroundColor Green


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Startup\Interactive_Manage_Startup_Apps.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# ==============================================================================
# SCRIPT: Manage Startup Apps
# TARGET SYSTEM: Windows 10 &amp; Windows 11
# DESCRIPTION: Scans and displays all registry and folder-based startup items.
#              Provides a non-destructive disable feature by moving registry items
#              to backup keys (Run-Disabled) and shortcut files to parallel directories.
# SAFETY LEVEL: Safe &amp; Fully Reversible
# ==============================================================================

$Host.UI.RawUI.WindowTitle = &quot;Windows Startup Apps Manager&quot;

# Registry Paths
$HKCU_Run = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\Run&quot;
$HKCU_RunDisabled = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\Run-Disabled&quot;
$HKLM_Run = &quot;HKLM:\Software\Microsoft\Windows\CurrentVersion\Run&quot;
$HKLM_RunDisabled = &quot;HKLM:\Software\Microsoft\Windows\CurrentVersion\Run-Disabled&quot;
$HKLM_Wow_Run = &quot;HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Run&quot;
$HKLM_Wow_RunDisabled = &quot;HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Run-Disabled&quot;

# Folders
$UserStartupDir = &quot;$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup&quot;
$UserStartupDisabledDir = &quot;$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup-Disabled&quot;
$CommonStartupDir = &quot;$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Startup&quot;
$CommonStartupDisabledDir = &quot;$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Startup-Disabled&quot;

# Ensure backup paths exist
function Ensure-Paths {
    if (-not (Test-Path $HKCU_RunDisabled)) { New-Item -Path $HKCU_RunDisabled -Force | Out-Null }
    if (-not (Test-Path $HKLM_RunDisabled)) { New-Item -Path $HKLM_RunDisabled -Force | Out-Null }
    if (-not (Test-Path $HKLM_Wow_RunDisabled)) { New-Item -Path $HKLM_Wow_RunDisabled -Force | Out-Null }
    if (-not (Test-Path $UserStartupDisabledDir)) { New-Item -Path $UserStartupDisabledDir -ItemType Directory -Force | Out-Null }
    if (-not (Test-Path $CommonStartupDisabledDir)) { New-Item -Path $CommonStartupDisabledDir -ItemType Directory -Force | Out-Null }
}

Ensure-Paths

function Clear-Console {
    Clear-Host
    Write-Host &quot;======================================================================&quot; -ForegroundColor Cyan
    Write-Host &quot;                       WINDOWS STARTUP APPS MANAGER                   &quot; -ForegroundColor Cyan
    Write-Host &quot;======================================================================&quot; -ForegroundColor Cyan
    Write-Host &quot;&quot;
}

function Get-StartupItems {
    $items = @()
    $id = 1

    # 1. HKCU Run
    $props = Get-Item -Path $HKCU_Run | Select-Object -ExpandProperty Property -ErrorAction SilentlyContinue
    foreach ($p in $props) {
        $val = (Get-ItemProperty -Path $HKCU_Run -Name $p).$p
        $items += [PSCustomObject]@{ Id = $id; Type = &quot;Registry (User)&quot;; Name = $p; Value = $val; Path = $HKCU_Run; DisabledPath = $HKCU_RunDisabled; IsDisabled = $false }
        $id++
    }

    # 2. HKLM Run
    $props = Get-Item -Path $HKLM_Run | Select-Object -ExpandProperty Property -ErrorAction SilentlyContinue
    foreach ($p in $props) {
        $val = (Get-ItemProperty -Path $HKLM_Run -Name $p).$p
        $items += [PSCustomObject]@{ Id = $id; Type = &quot;Registry (System)&quot;; Name = $p; Value = $val; Path = $HKLM_Run; DisabledPath = $HKLM_RunDisabled; IsDisabled = $false }
        $id++
    }

    # 3. HKLM Wow6432Node Run
    $props = Get-Item -Path $HKLM_Wow_Run | Select-Object -ExpandProperty Property -ErrorAction SilentlyContinue
    foreach ($p in $props) {
        $val = (Get-ItemProperty -Path $HKLM_Wow_Run -Name $p).$p
        $items += [PSCustomObject]@{ Id = $id; Type = &quot;Registry (System-Wow64)&quot;; Name = $p; Value = $val; Path = $HKLM_Wow_Run; DisabledPath = $HKLM_Wow_RunDisabled; IsDisabled = $false }
        $id++
    }

    # 4. User Startup Folder
    if (Test-Path $UserStartupDir) {
        $files = Get-ChildItem -Path $UserStartupDir -Filter &quot;*.lnk&quot;
        foreach ($f in $files) {
            $items += [PSCustomObject]@{ Id = $id; Type = &quot;Folder (User)&quot;; Name = $f.Name; Value = $f.FullName; Path = $UserStartupDir; DisabledPath = $UserStartupDisabledDir; IsDisabled = $false }
            $id++
        }
    }

    # 5. Common Startup Folder
    if (Test-Path $CommonStartupDir) {
        $files = Get-ChildItem -Path $CommonStartupDir -Filter &quot;*.lnk&quot;
        foreach ($f in $files) {
            $items += [PSCustomObject]@{ Id = $id; Type = &quot;Folder (System)&quot;; Name = $f.Name; Value = $f.FullName; Path = $CommonStartupDir; DisabledPath = $CommonStartupDisabledDir; IsDisabled = $false }
            $id++
        }
    }

    return $items
}

function Get-DisabledItems {
    $items = @()
    $id = 1

    # 1. HKCU Run Disabled
    $props = Get-Item -Path $HKCU_RunDisabled | Select-Object -ExpandProperty Property -ErrorAction SilentlyContinue
    foreach ($p in $props) {
        $val = (Get-ItemProperty -Path $HKCU_RunDisabled -Name $p).$p
        $items += [PSCustomObject]@{ Id = $id; Type = &quot;Registry (User)&quot;; Name = $p; Value = $val; Path = $HKCU_RunDisabled; EnabledPath = $HKCU_Run; IsDisabled = $true }
        $id++
    }

    # 2. HKLM Run Disabled
    $props = Get-Item -Path $HKLM_RunDisabled | Select-Object -ExpandProperty Property -ErrorAction SilentlyContinue
    foreach ($p in $props) {
        $val = (Get-ItemProperty -Path $HKLM_RunDisabled -Name $p).$p
        $items += [PSCustomObject]@{ Id = $id; Type = &quot;Registry (System)&quot;; Name = $p; Value = $val; Path = $HKLM_RunDisabled; EnabledPath = $HKLM_Run; IsDisabled = $true }
        $id++
    }

    # 3. HKLM Wow6432Node Run Disabled
    $props = Get-Item -Path $HKLM_Wow_RunDisabled | Select-Object -ExpandProperty Property -ErrorAction SilentlyContinue
    foreach ($p in $props) {
        $val = (Get-ItemProperty -Path $HKLM_Wow_RunDisabled -Name $p).$p
        $items += [PSCustomObject]@{ Id = $id; Type = &quot;Registry (System-Wow64)&quot;; Name = $p; Value = $val; Path = $HKLM_Wow_RunDisabled; EnabledPath = $HKLM_Wow_Run; IsDisabled = $true }
        $id++
    }

    # 4. User Startup Folder Disabled
    if (Test-Path $UserStartupDisabledDir) {
        $files = Get-ChildItem -Path $UserStartupDisabledDir -Filter &quot;*.lnk&quot;
        foreach ($f in $files) {
            $items += [PSCustomObject]@{ Id = $id; Type = &quot;Folder (User)&quot;; Name = $f.Name; Value = $f.FullName; Path = $UserStartupDisabledDir; EnabledPath = $UserStartupDir; IsDisabled = $true }
            $id++
        }
    }

    # 5. Common Startup Folder Disabled
    if (Test-Path $CommonStartupDisabledDir) {
        $files = Get-ChildItem -Path $CommonStartupDisabledDir -Filter &quot;*.lnk&quot;
        foreach ($f in $files) {
            $items += [PSCustomObject]@{ Id = $id; Type = &quot;Folder (System)&quot;; Name = $f.Name; Value = $f.FullName; Path = $CommonStartupDisabledDir; EnabledPath = $CommonStartupDir; IsDisabled = $true }
            $id++
        }
    }

    return $items
}

while ($true) {
    Clear-Console
    Write-Host &quot;Choose an action:&quot; -ForegroundColor White
    Write-Host &quot;  1. List Active Startup Apps &amp; Disable Items&quot; -ForegroundColor Green
    Write-Host &quot;  2. List Disabled Startup Apps &amp; Re-enable Items&quot; -ForegroundColor Yellow
    Write-Host &quot;  3. Exit&quot; -ForegroundColor Red
    Write-Host &quot;&quot;
    
    $op = Read-Host &quot;Option (1-3)&quot;

    if ($op -eq &quot;1&quot;) {
        while ($true) {
            Clear-Console
            $actives = Get-StartupItems
            Write-Host &quot;=== Active Startup Apps ===&quot; -ForegroundColor Green
            Write-Host &quot;&quot;
            
            if ($actives.Count -eq 0) {
                Write-Host &quot;No active startup applications found!&quot; -ForegroundColor Yellow
                Write-Host &quot;&quot;
                Read-Host &quot;Press Enter to return to main menu...&quot;
                break
            }

            foreach ($item in $actives) {
                Write-Host &quot;  [$($item.Id)] $($item.Name)&quot; -ForegroundColor White
                Write-Host &quot;       Source: $($item.Type)&quot; -ForegroundColor Gray
                Write-Host &quot;       Command: $($item.Value)&quot; -ForegroundColor Gray
                Write-Host &quot;&quot;
            }

            $select = Read-Host &quot;Select number to DISABLE (or &apos;q&apos; to go back)&quot;
            if ($select -eq &quot;q&quot;) { break }

            $match = $actives | Where-Object { $_.Id -eq $select }
            if ($match) {
                try {
                    if ($match.Type -like &quot;Registry*&quot;) {
                        # Move Registry value to disabled key
                        Set-ItemProperty -Path $match.DisabledPath -Name $match.Name -Value $match.Value -Force | Out-Null
                        Remove-ItemProperty -Path $match.Path -Name $match.Name -Force | Out-Null
                    } else {
                        # Move shortcut file to disabled folder
                        $targetPath = Join-Path $match.DisabledPath $match.Name
                        Move-Item -Path $match.Value -Destination $targetPath -Force | Out-Null
                    }
                    Write-Host &quot;&quot;
                    Write-Host &quot;[+] Disabled $($match.Name) successfully!&quot; -ForegroundColor Green
                    Start-Sleep -Seconds 1
                } catch {
                    Write-Host &quot;&quot;
                    Write-Host &quot;[!] Error: Failed to disable $($match.Name). Make sure you run this script as Administrator if modifying System startup items.&quot; -ForegroundColor Red
                    Write-Host $_.Exception.Message -ForegroundColor Gray
                    Read-Host &quot;Press Enter to continue...&quot;
                }
            } else {
                Write-Host &quot;Invalid selection.&quot; -ForegroundColor Red
                Start-Sleep -Seconds 1
            }
        }
    }
    elseif ($op -eq &quot;2&quot;) {
        while ($true) {
            Clear-Console
            $disableds = Get-DisabledItems
            Write-Host &quot;=== Disabled Startup Apps ===&quot; -ForegroundColor Yellow
            Write-Host &quot;&quot;

            if ($disableds.Count -eq 0) {
                Write-Host &quot;No disabled startup applications found!&quot; -ForegroundColor Yellow
                Write-Host &quot;&quot;
                Read-Host &quot;Press Enter to return to main menu...&quot;
                break
            }

            foreach ($item in $disableds) {
                Write-Host &quot;  [$($item.Id)] $($item.Name)&quot; -ForegroundColor White
                Write-Host &quot;       Source: $($item.Type)&quot; -ForegroundColor Gray
                Write-Host &quot;       Command: $($item.Value)&quot; -ForegroundColor Gray
                Write-Host &quot;&quot;
            }

            $select = Read-Host &quot;Select number to RE-ENABLE (or &apos;q&apos; to go back)&quot;
            if ($select -eq &quot;q&quot;) { break }

            $match = $disableds | Where-Object { $_.Id -eq $select }
            if ($match) {
                try {
                    if ($match.Type -like &quot;Registry*&quot;) {
                        # Move Registry value back to enabled key
                        Set-ItemProperty -Path $match.EnabledPath -Name $match.Name -Value $match.Value -Force | Out-Null
                        Remove-ItemProperty -Path $match.Path -Name $match.Name -Force | Out-Null
                    } else {
                        # Move shortcut file back to startup folder
                        $targetPath = Join-Path $match.EnabledPath $match.Name
                        Move-Item -Path $match.Value -Destination $targetPath -Force | Out-Null
                    }
                    Write-Host &quot;&quot;
                    Write-Host &quot;[+] Re-enabled $($match.Name) successfully!&quot; -ForegroundColor Green
                    Start-Sleep -Seconds 1
                } catch {
                    Write-Host &quot;&quot;
                    Write-Host &quot;[!] Error: Failed to re-enable $($match.Name). Make sure you run this script as Administrator if modifying System startup items.&quot; -ForegroundColor Red
                    Write-Host $_.Exception.Message -ForegroundColor Gray
                    Read-Host &quot;Press Enter to continue...&quot;
                }
            } else {
                Write-Host &quot;Invalid selection.&quot; -ForegroundColor Red
                Start-Sleep -Seconds 1
            }
        }
    }
    elseif ($op -eq &quot;3&quot;) {
        Write-Host &quot;Exiting...&quot; -ForegroundColor Cyan
        break
    }
}

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Storage\Safe Temporary Cleanup.bat">
@echo off
:: ==============================================================================
:: SCRIPT: Safe Temporary Cleanup
:: TARGET SYSTEM: Windows 10 &amp; Windows 11
:: DESCRIPTION: Safely purges temporary files, cache folders, and empties the 
::              Recycle Bin without affecting system updates or core components.
:: SAFETY LEVEL: 100% Safe to run anytime
:: ==============================================================================
title Safe Temporary Cleanup
setlocal enabledelayedexpansion

:: Check Admin Rights
openfiles &gt;nul 2&gt;&amp;1
if %errorlevel% neq 0 (
    echo [!] ERROR: This script must be run as Administrator.
    echo Please right-click the script and select &apos;Run as Administrator&apos;.
    echo.
    pause
    exit /b
)

:: Header
cls
echo ======================================================================
echo                        SAFE TEMPORARY CLEANUP
echo ======================================================================
echo.
echo [*] Checking Windows Version...
for /f &quot;tokens=4-5 delims=. &quot; %%i in (&apos;ver&apos;) do set WIN_VER=%%i.%%j
for /f &quot;tokens=6 delims=[.] &quot; %%i in (&apos;ver&apos;) do set WIN_BUILD=%%i
echo [*] System Build: !WIN_BUILD!
echo.
echo Starting Safe Maintenance Cleanup...
echo --------------------------------------------------

:: 1. Emptying Recycle Bin
echo [*] Emptying Recycle Bin...
powershell.exe -NoProfile -Command &quot;Clear-RecycleBin -Confirm:$false -ErrorAction SilentlyContinue&quot; &gt;nul 2&gt;&amp;1
echo [+] Recycle Bin cleared.

:: 2. Cleaning User Temp Folder
echo [*] Purging User Temp directory (%temp%)...
del /s /f /q &quot;%temp%\*.*&quot; &gt;nul 2&gt;&amp;1
for /d %%p in (&quot;%temp%\*&quot;) do rmdir /s /q &quot;%%p&quot; &gt;nul 2&gt;&amp;1
echo [+] User Temp cleared.

:: 3. Cleaning System Temp Folder
echo [*] Purging System Temp directory (Windows\Temp)...
del /s /f /q &quot;%WINDIR%\Temp\*.*&quot; &gt;nul 2&gt;&amp;1
for /d %%p in (&quot;%WINDIR%\Temp\*&quot;) do rmdir /s /q &quot;%%p&quot; &gt;nul 2&gt;&amp;1
echo [+] System Temp cleared.

:: 4. Cleaning Log Files
echo [*] Cleaning Log files (CBS, MoSetup, Panther)...
del /s /f /q &quot;%WINDIR%\logs\cbs\*.log&quot; &gt;nul 2&gt;&amp;1
del /s /f /q &quot;%WINDIR%\Logs\MoSetup\*.log&quot; &gt;nul 2&gt;&amp;1
del /s /f /q &quot;%WINDIR%\Panther\*.log&quot; &gt;nul 2&gt;&amp;1
del /s /f /q &quot;%WINDIR%\inf\*.log&quot; &gt;nul 2&gt;&amp;1
del /s /f /q &quot;%WINDIR%\logs\*.log&quot; &gt;nul 2&gt;&amp;1
echo [+] System logs cleaned.

:: 5. Cleaning Windows Update download Cache (Safe)
echo [*] Cleaning Windows Update Download Cache (SoftwareDistribution\Download)...
net stop wuauserv &gt;nul 2&gt;&amp;1
net stop UsoSvc &gt;nul 2&gt;&amp;1
del /s /f /q &quot;%WINDIR%\SoftwareDistribution\Download\*.*&quot; &gt;nul 2&gt;&amp;1
for /d %%p in (&quot;%WINDIR%\SoftwareDistribution\Download\*&quot;) do rmdir /s /q &quot;%%p&quot; &gt;nul 2&gt;&amp;1
net start wuauserv &gt;nul 2&gt;&amp;1
net start UsoSvc &gt;nul 2&gt;&amp;1
echo [+] Windows Update Download Cache cleared.

echo --------------------------------------------------
echo [+] Safe maintenance cleanup finished successfully!
echo.
pause
exit /b

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Storage-Advanced\Analyze_SSD_Health.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Analyze SSD Health (Tweaks/Storage-Advanced/Analyze_SSD_Health.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

Write-Host &quot;=================================================&quot;
Write-Host &quot;   SSD &amp; NVME HEALTH ANALYZER&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;Gathering physical disk SMART data and wear indicators...&quot;
Write-Host &quot;=================================================`n&quot;

$Disks = Get-PhysicalDisk | Where-Object MediaType -in @(&quot;SSD&quot;, &quot;Unspecified&quot;)

if ($Disks.Count -eq 0) {
    Write-Host &quot;[INFO] No SSDs detected by the Windows storage subsystem.&quot; -ForegroundColor Yellow
}

foreach ($Disk in $Disks) {
    Write-Host &quot;Drive: $($Disk.FriendlyName)&quot; -ForegroundColor Cyan
    Write-Host &quot;Health Status: $($Disk.HealthStatus)&quot;
    Write-Host &quot;Operational Status: $($Disk.OperationalStatus)&quot;
    Write-Host &quot;Bus Type: $($Disk.BusType)&quot;
    
    # Storage Reliability Counters (Requires StorageSpaces or proper NVMe drivers)
    $Counters = $Disk | Get-StorageReliabilityCounter -ErrorAction SilentlyContinue
    
    if ($Counters) {
        Write-Host &quot;Temperature: $($Counters.Temperature) C&quot;
        
        if ($Counters.Wear -ne $null) {
            Write-Host &quot;Wear Indicator: $($Counters.Wear)%&quot;
            if ($Counters.Wear -lt 10) {
                Write-Host &quot;-&gt; Drive is heavily worn.&quot; -ForegroundColor Red
            } else {
                Write-Host &quot;-&gt; Drive wear is acceptable.&quot; -ForegroundColor Green
            }
        } else {
            Write-Host &quot;Wear Indicator: Not reported by firmware.&quot; -ForegroundColor DarkGray
        }
    } else {
        Write-Host &quot;SMART/Reliability Counters: Not exposed to Windows (generic driver or RAID).&quot; -ForegroundColor DarkGray
    }
    Write-Host &quot;-------------------------------------------------&quot;
}

if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Storage-Advanced\Check_TRIM_Status.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Check TRIM Status (Tweaks/Storage-Advanced/Check_TRIM_Status.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   SSD / NVME TRIM DIAGNOSTICS&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;TRIM is essential for maintaining SSD performance and lifespan.&quot;
Write-Host &quot;This script will check if Windows is sending TRIM commands.&quot;
Write-Host &quot;=================================================`n&quot;

$TrimStatus = fsutil behavior query DisableDeleteNotify

# Parse NTFS status
if ($TrimStatus -match &quot;NTFS DisableDeleteNotify = 0&quot;) {
    Write-Host &quot;[NTFS] TRIM is ENABLED (Optimal)&quot; -ForegroundColor Green
} elseif ($TrimStatus -match &quot;NTFS DisableDeleteNotify = 1&quot;) {
    Write-Host &quot;[NTFS] TRIM is DISABLED (Bad for SSDs)&quot; -ForegroundColor Red
} else {
    Write-Host &quot;[NTFS] TRIM status unknown&quot; -ForegroundColor Yellow
}

# Parse ReFS status
if ($TrimStatus -match &quot;ReFS DisableDeleteNotify = 0&quot;) {
    Write-Host &quot;[ReFS] TRIM is ENABLED (Optimal)&quot; -ForegroundColor Green
} elseif ($TrimStatus -match &quot;ReFS DisableDeleteNotify = 1&quot;) {
    Write-Host &quot;[ReFS] TRIM is DISABLED&quot; -ForegroundColor Red
}

Write-Host &quot;`nDo you want to force-enable TRIM for all file systems? (Y/N)&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -match &apos;y&apos;) {
    Write-Host &quot;`nEnabling TRIM...&quot; -ForegroundColor Yellow
    fsutil behavior set DisableDeleteNotify 0 | Out-Null
    Write-FrameworkLog -ModuleName &quot;Storage&quot; -Action &quot;Enabled SSD TRIM&quot;
    Write-Host &quot;[SUCCESS] TRIM is now fully enabled.&quot; -ForegroundColor Green
} else {
    Write-Host &quot;`nNo changes made.&quot;
}



$null = Read-Host &quot;Press Enter to exit...&quot;


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Storage-Advanced\Optimize_Pagefile_Configuration.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Optimize Pagefile (Tweaks/Storage-Advanced/Optimize_Pagefile_Configuration.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force
$SnapshotDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Restore&quot;

Write-Host &quot;=================================================&quot;
Write-Host &quot;   SMART PAGEFILE &amp; VIRTUAL MEMORY MANAGER&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;MYTH: &apos;Disabling the pagefile gives you more FPS.&apos;&quot;
Write-Host &quot;FACT: Windows relies on the pagefile for memory commit.&quot;
Write-Host &quot;Disabling it entirely can cause games to crash instantly&quot;
Write-Host &quot;when VRAM/RAM allocations spike, and it disables crash dumps.&quot;
Write-Host &quot;=================================================&quot;
Write-Host &quot;1. System Managed (Recommended/Safe Default)&quot;
Write-Host &quot;2. Fixed Size (16GB) (For Heavy Gaming/Simulators)&quot;
Write-Host &quot;3. Abort&quot;
Write-Host &quot;=================================================&quot;
$Choice = Read-Host &quot;Select an option [1-3]&quot;

if ($Choice -notmatch &apos;^[1-2]$&apos;) {
    Write-FrameworkLog -ModuleName &quot;Storage&quot; -Action &quot;Aborted Pagefile config&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Storage&quot; -Action &quot;Backing up Pagefile registry settings&quot;
$RegPath1 = &quot;HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management&quot;
$BackupFile = Join-Path -Path $SnapshotDir -ChildPath &quot;Pagefile_Backup_$(Get-Date -Format &apos;yyyyMMdd_HHmmss&apos;).reg&quot;
&amp; reg export $RegPath1 $BackupFile /y | Out-Null

$SysKey = &quot;HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management&quot;

if ($Choice -eq &apos;1&apos;) {
    Write-Host &quot;`nSetting Pagefile to System Managed...&quot; -ForegroundColor Yellow
    $ComputerSystem = Get-WmiObject -Class Win32_ComputerSystem -EnableAllPrivileges
    $ComputerSystem.AutomaticManagedPagefile = $true
    $ComputerSystem.Put() | Out-Null
    
    Write-FrameworkLog -ModuleName &quot;Storage&quot; -Action &quot;Set Pagefile to System Managed&quot;
    Write-Host &quot;[SUCCESS] Pagefile is now System Managed.&quot; -ForegroundColor Green
} else {
    Write-Host &quot;`nSetting Pagefile to Fixed 16GB...&quot; -ForegroundColor Yellow
    $ComputerSystem = Get-WmiObject -Class Win32_ComputerSystem -EnableAllPrivileges
    $ComputerSystem.AutomaticManagedPagefile = $false
    $ComputerSystem.Put() | Out-Null
    
    $PageFile = Get-WmiObject -Class Win32_PageFileSetting
    if ($PageFile) {
        $PageFile.InitialSize = 16384
        $PageFile.MaximumSize = 16384
        $PageFile.Put() | Out-Null
    } else {
        Set-WmiInstance -Class Win32_PageFileSetting -Arguments @{Name=&quot;C:\pagefile.sys&quot;; InitialSize=16384; MaximumSize=16384} | Out-Null
    }

    Write-FrameworkLog -ModuleName &quot;Storage&quot; -Action &quot;Set Pagefile to Fixed 16GB&quot;
    Write-Host &quot;[SUCCESS] Pagefile is now fixed to 16GB.&quot; -ForegroundColor Green
}

Write-Host &quot;A SYSTEM REBOOT is required for virtual memory changes to take effect.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Storage-Aggressive\Deep Component Cleanup (Aggressive).bat">
@echo off
:: ==============================================================================
:: SCRIPT: Deep Component Store Cleanup (Aggressive)
:: TARGET SYSTEM: Windows 10 &amp; Windows 11
:: DESCRIPTION: Compresses the Windows component store and deletes all historical 
::              backups of previously installed updates. 
:: WARNING: This operation is IRREVERSIBLE. Once complete, currently installed 
::          updates CANNOT be uninstalled or rolled back!
:: SAFETY LEVEL: Aggressive (Requires Confirmation)
:: ==============================================================================
title Deep Component Store Cleanup
setlocal enabledelayedexpansion

:: Check Admin Rights
openfiles &gt;nul 2&gt;&amp;1
if %errorlevel% neq 0 (
    echo [!] ERROR: This script must be run as Administrator.
    echo Please right-click the script and select &apos;Run as Administrator&apos;.
    echo.
    pause
    exit /b
)

cls
echo ======================================================================
echo             CRITICAL WARNING: AGGRESSIVE COMPONENT CLEANUP
echo ======================================================================
echo.
echo  [!] WARNING: This script performs a deep system store purge using:
echo      DISM.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
echo.
echo  [*] WHAT THIS ACTUALLY CHANGES:
echo      - Deletes all historical update versions from the component store (WinSxS).
echo      - Reclaims significant gigabytes of wasted hard drive space.
echo.
echo  [!] CRITICAL DRAWBACKS / RISK:
echo      - This operation is IRREVERSIBLE.
echo      - Once run, currently installed Windows updates CANNOT be uninstalled.
echo      - You will NOT be able to roll back to previous updates if a bug occurs.
echo.
echo ======================================================================
echo.

set /p confirm=To confirm and proceed, please type &quot;AGREE&quot; (case-sensitive): 

if not &quot;!confirm!&quot;==&quot;AGREE&quot; (
    echo.
    echo [x] Confirmation failed. Exiting without making changes...
    echo.
    timeout /t 5
    exit /b
)

echo.
echo --------------------------------------------------
echo [*] Confirmation successful! Starting deep cleanup...
echo [*] Please do NOT turn off your PC during this time.
echo --------------------------------------------------
echo.

echo [*] Compressing and purging older Windows components...
dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase

echo.
echo --------------------------------------------------
echo [+] Deep Component Store Cleanup finished successfully!
echo [+] Gigabytes of disk space have been reclaimed.
echo --------------------------------------------------
echo.
pause
exit /b

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Sync\Apply_Privacy_Sync_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Privacy Sync Profile (Tweaks/Sync/Apply_Privacy_Sync_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY PRIVACY SYNC PROFILE&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile disables background telemetry and data syncing.&quot;
Write-Host &quot;It disables Timeline Activity History tracking and blocks Windows&quot;
Write-Host &quot;from syncing your passwords, themes, and settings to the cloud.&quot;
Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Sync&quot; -Action &quot;Aborted Privacy Sync Profile Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Sync&quot; -Action &quot;Starting Master Privacy Sync Orchestrator&quot; -Level WARNING

$ScriptDir = $PSScriptRoot

Write-Host &quot;`n[1/2] Disabling Activity History and Timeline tracking...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Activity_History.ps1&quot;) -Force:$Force

Write-Host &quot;`n[2/2] Disabling Windows Settings Cloud Syncing...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Windows_Settings_Sync.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Sync&quot; -Action &quot;Completed Master Privacy Sync Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Privacy Sync Profile deployment complete!&quot; -ForegroundColor Green
if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Sync\Disable_Activity_History.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Activity History (Tweaks/Sync/Disable_Activity_History.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Sync&quot; -Action &quot;Initiating Activity History Disablement&quot;

$RegistryPath = &quot;HKLM:\SOFTWARE\Policies\Microsoft\Windows\System&quot;
if (-not (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null }

# 1. Disable Activity Feed (Timeline)
$NameFeed = &quot;EnableActivityFeed&quot;
$CurrentFeed = (Get-ItemProperty -Path $RegistryPath -Name $NameFeed -ErrorAction SilentlyContinue).$NameFeed
if ($null -eq $CurrentFeed) { $CurrentFeed = &quot;Not_Set&quot; }

Set-ItemProperty -Path $RegistryPath -Name $NameFeed -Value 0 -Type DWord -Force
Write-FrameworkLog -ModuleName &quot;Sync&quot; -Action &quot;Disabled Activity Feed&quot; -OldValue $CurrentFeed -NewValue &quot;0&quot;

# 2. Disable Publishing User Activities
$NamePublish = &quot;PublishUserActivities&quot;
$CurrentPublish = (Get-ItemProperty -Path $RegistryPath -Name $NamePublish -ErrorAction SilentlyContinue).$NamePublish
if ($null -eq $CurrentPublish) { $CurrentPublish = &quot;Not_Set&quot; }

Set-ItemProperty -Path $RegistryPath -Name $NamePublish -Value 0 -Type DWord -Force
Write-FrameworkLog -ModuleName &quot;Sync&quot; -Action &quot;Disabled Publishing User Activities&quot; -OldValue $CurrentPublish -NewValue &quot;0&quot;

Write-Host &quot;`n[SUCCESS] Windows Activity History and Timeline tracking have been disabled.&quot; -ForegroundColor Green
Write-Host &quot;Windows will no longer secretly track which files/apps you open.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Sync\Disable_Windows_Settings_Sync.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Windows Settings Sync (Tweaks/Sync/Disable_Windows_Settings_Sync.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Sync&quot; -Action &quot;Initiating Windows Settings Sync Disablement&quot;

$RegistryPath = &quot;HKLM:\Software\Policies\Microsoft\Windows\SettingSync&quot;
if (-not (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null }

# 1. Disable Settings Sync (2 = Disabled completely)
$NameSync = &quot;DisableSettingSync&quot;
$CurrentSync = (Get-ItemProperty -Path $RegistryPath -Name $NameSync -ErrorAction SilentlyContinue).$NameSync
if ($null -eq $CurrentSync) { $CurrentSync = &quot;Not_Set&quot; }

Set-ItemProperty -Path $RegistryPath -Name $NameSync -Value 2 -Type DWord -Force
Write-FrameworkLog -ModuleName &quot;Sync&quot; -Action &quot;Disabled Settings Sync&quot; -OldValue $CurrentSync -NewValue &quot;2&quot;

# 2. Disable User Override
$NameOverride = &quot;DisableSettingSyncUserOverride&quot;
$CurrentOverride = (Get-ItemProperty -Path $RegistryPath -Name $NameOverride -ErrorAction SilentlyContinue).$NameOverride
if ($null -eq $CurrentOverride) { $CurrentOverride = &quot;Not_Set&quot; }

Set-ItemProperty -Path $RegistryPath -Name $NameOverride -Value 1 -Type DWord -Force
Write-FrameworkLog -ModuleName &quot;Sync&quot; -Action &quot;Disabled Settings Sync User Override&quot; -OldValue $CurrentOverride -NewValue &quot;1&quot;

Write-Host &quot;`n[SUCCESS] Windows Settings Sync has been disabled.&quot; -ForegroundColor Green
Write-Host &quot;Your passwords, themes, and preferences will remain strictly local.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Sync\Uninstall_OneDrive.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Uninstall OneDrive (Tweaks/Sync/Uninstall_OneDrive.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Sync&quot; -Action &quot;Initiating OneDrive Uninstall&quot;

Write-Host &quot;=================================================&quot;
Write-Host &quot;   UNINSTALL ONEDRIVE &amp; SYNC ISOLATION&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This script will completely uninstall OneDrive from your system&quot;
Write-Host &quot;and remove its icon from the Windows Explorer sidebar.&quot;
Write-Host &quot;WARNING: Any files stored ONLY in OneDrive (Files On-Demand)&quot;
Write-Host &quot;will become inaccessible unless downloaded first!&quot;
Write-Host &quot;Press &apos;Y&apos; to confirm or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Sync&quot; -Action &quot;Aborted OneDrive Uninstall&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

# 1. Kill OneDrive Processes
Write-Host &quot;`n[1/3] Terminating OneDrive processes...&quot; -ForegroundColor Cyan
Stop-Process -Name &quot;OneDrive&quot; -Force -ErrorAction SilentlyContinue
Stop-Process -Name &quot;Microsoft.SharePoint&quot; -Force -ErrorAction SilentlyContinue
Start-Sleep -Seconds 2

# 2. Uninstall OneDrive
Write-Host &quot;[2/3] Uninstalling OneDrive...&quot; -ForegroundColor Cyan
$ODSetup = &quot;$env:SystemRoot\SysWOW64\OneDriveSetup.exe&quot;
if (-not (Test-Path $ODSetup)) {
    $ODSetup = &quot;$env:SystemRoot\System32\OneDriveSetup.exe&quot;
}

if (Test-Path $ODSetup) {
    Start-Process -FilePath $ODSetup -ArgumentList &quot;/uninstall&quot; -Wait -NoNewWindow
    Write-FrameworkLog -ModuleName &quot;Sync&quot; -Action &quot;Uninstalled OneDrive Executable&quot;
} else {
    Write-Host &quot;OneDrive installer not found, it may already be uninstalled.&quot; -ForegroundColor Yellow
}

# 3. Remove Explorer Navigation Pane Icon
Write-Host &quot;[3/3] Removing OneDrive from Explorer sidebar...&quot; -ForegroundColor Cyan
$RegistryPath = &quot;HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}&quot;
if (Test-Path $RegistryPath) {
    Set-ItemProperty -Path $RegistryPath -Name &quot;System.IsPinnedToNameSpaceTree&quot; -Value 0 -Type DWord -Force
    Write-FrameworkLog -ModuleName &quot;Sync&quot; -Action &quot;Removed OneDrive Explorer Icon&quot;
}

# 4. Remove OneDrive from 64-bit Explorer sidebar
$RegistryPath64 = &quot;HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}&quot;
if (Test-Path $RegistryPath64) {
    Set-ItemProperty -Path $RegistryPath64 -Name &quot;System.IsPinnedToNameSpaceTree&quot; -Value 0 -Type DWord -Force
}

Write-Host &quot;`n[SUCCESS] OneDrive has been uninstalled.&quot; -ForegroundColor Green


$null = Read-Host &quot;Press Enter to exit...&quot;


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\System\Disable Windows Update.bat">
@echo off
setlocal enabledelayedexpansion

:: BatchGotAdmin
REM  --&gt; Check for permissions
    IF &quot;%PROCESSOR_ARCHITECTURE%&quot; EQU &quot;amd64&quot; (
&gt;nul 2&gt;&amp;1 &quot;%SYSTEMROOT%\SysWOW64\cacls.exe&quot; &quot;%SYSTEMROOT%\SysWOW64\config\system&quot;
) ELSE (
&gt;nul 2&gt;&amp;1 &quot;%SYSTEMROOT%\system32\cacls.exe&quot; &quot;%SYSTEMROOT%\system32\config\system&quot;
)

REM --&gt; If error flag set, we do not have admin.
if &apos;%errorlevel%&apos; NEQ &apos;0&apos; (
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^(&quot;Shell.Application&quot;^) &gt; &quot;%temp%\getadmin.vbs&quot;
    set params= %*
    echo UAC.ShellExecute &quot;cmd.exe&quot;, &quot;/c &quot;&quot;%~s0&quot;&quot; %params:&quot;=&quot;&quot;&quot;%&quot;, &quot;&quot;, &quot;runas&quot;, 1 &gt;&gt; &quot;%temp%\getadmin.vbs&quot;

    cscript //nologo &quot;%temp%\getadmin.vbs&quot;
    del &quot;%temp%\getadmin.vbs&quot;
    exit /B

:gotAdmin
    pushd &quot;%CD%&quot;
    CD /D &quot;%~dp0&quot; 

:: Disable update related services
for %%i in (wuauserv, UsoSvc, uhssvc, WaaSMedicSvc) do (
	net stop %%i
	sc config %%i start= disabled
	sc failure %%i reset= 0 actions= &quot;&quot;
)

:: Brute force rename services
for %%i in (WaaSMedicSvc, wuaueng) do (
	takeown /f C:\Windows\System32\%%i.dll &amp;&amp; icacls C:\Windows\System32\%%i.dll /grant *S-1-1-0:F
	rename C:\Windows\System32\%%i.dll %%i_BAK.dll
	icacls C:\Windows\System32\%%i_BAK.dll /setowner &quot;NT SERVICE\TrustedInstaller&quot; &amp;&amp; icacls C:\Windows\System32\%%i_BAK.dll /remove *S-1-1-0
)

:: Update registry
reg add &quot;HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc&quot; /v Start /t REG_DWORD /d 4 /f
reg add &quot;HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc&quot; /v FailureActions /t REG_BINARY /d 000000000000000000000000030000001400000000000000c0d4010000000000e09304000000000000000000 /f
reg add &quot;HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU&quot; /v NoAutoUpdate /t REG_DWORD /d 1 /f

:: Delete downloaded update files
erase /f /s /q c:\windows\softwaredistribution\*.* &amp;&amp; rmdir /s /q c:\windows\softwaredistribution

:: Disable all update related scheduled tasks
schtasks /change /tn &quot;\Microsoft\Windows\InstallService\*&quot; /disable
schtasks /change /tn &quot;\Microsoft\Windows\UpdateOrchestrator\*&quot; /disable
schtasks /change /tn &quot;\Microsoft\Windows\UpdateAssistant\*&quot; /disable
schtasks /change /tn &quot;\Microsoft\Windows\WaaSMedic\*&quot; /disable
schtasks /change /tn &quot;\Microsoft\Windows\WindowsUpdate\*&quot; /disable
schtasks /change /tn &quot;\Microsoft\WindowsUpdate\*&quot; /disable

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\System\Extreme_Debloat.ps1">
# ==========================================
# Extreme Debloat Script for WinAurex
# ==========================================
Write-Host &quot;Running Extreme Debloat...&quot;

# 1. Disable More Telemetry &amp; Bloat Services
$servicesToDisable = @(
    &quot;DiagTrack&quot;,       # Connected User Experiences and Telemetry
    &quot;dmwappushservice&quot;,# WAP Push Message Routing Service
    &quot;WSearch&quot;,         # Windows Search (extreme debloat often disables indexing)
    &quot;MapsBroker&quot;,      # Downloaded Maps Manager
    &quot;lfsvc&quot;,           # Geolocation Service
    &quot;XblAuthManager&quot;,  # Xbox Live Auth Manager
    &quot;XblGameSave&quot;,     # Xbox Live Game Save
    &quot;XboxNetApiSvc&quot;,   # Xbox Live Networking Service
    &quot;WaaSMedicSvc&quot;,    # Windows Update Medic Service
    &quot;DusmSvc&quot;          # Data Usage
)
foreach ($svc in $servicesToDisable) {
    Set-Service -Name $svc -StartupType Disabled -ErrorAction SilentlyContinue
}

# 2. Prevent OneDrive Setup
reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\OneDrive&quot; /v DisableFileSyncNGSC /t REG_DWORD /d 1 /f
reg.exe delete &quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Run&quot; /v &quot;OneDriveSetup&quot; /f
Remove-Item -Path &quot;$env:SystemRoot\SysWOW64\OneDriveSetup.exe&quot; -Force -ErrorAction SilentlyContinue
Remove-Item -Path &quot;$env:SystemRoot\System32\OneDriveSetup.exe&quot; -Force -ErrorAction SilentlyContinue

# 3. Disable Automatic App Downloads (Candy Crush, etc)
reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent&quot; /v DisableWindowsConsumerFeatures /t REG_DWORD /d 1 /f
reg.exe add &quot;HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager&quot; /v SilentInstalledAppsEnabled /t REG_DWORD /d 0 /f

# 4. Remove Capabilities (Features on Demand)
$caps = @(
    &quot;App.StepsRecorder~~~~0.0.1.0&quot;,
    &quot;MathRecognizer~~~~0.0.1.0&quot;,
    &quot;Microsoft.Windows.WordPad~~~~0.0.1.0&quot;,
    &quot;Print.Fax.Scan~~~~0.0.1.0&quot;,
    &quot;WMI-SNMP-Provider.Client~~~~0.0.1.0&quot;,
    &quot;Browser.InternetExplorer~~~~0.0.11.0&quot;,
    &quot;Media.WindowsMediaPlayer~~~~0.0.12.0&quot;,
    &quot;Hello.Face.18967~~~~0.0.1.0&quot;
)
foreach ($cap in $caps) {
    Remove-WindowsCapability -Online -Name $cap -ErrorAction SilentlyContinue
}

# 5. Disable More Scheduled Tasks
$tasksToDisable = @(
    &quot;\Microsoft\Windows\Windows Error Reporting\QueueReporting&quot;,
    &quot;\Microsoft\Windows\Feedback\Siuf\DmClient&quot;,
    &quot;\Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload&quot;,
    &quot;\Microsoft\Windows\AppID\SmartScreenSpecific&quot;,
    &quot;\Microsoft\Windows\Location\Notifications&quot;,
    &quot;\Microsoft\Windows\Maps\MapsToastTask&quot;,
    &quot;\Microsoft\Windows\Maps\MapsUpdateTask&quot;
)
foreach ($task in $tasksToDisable) {
    Disable-ScheduledTask -TaskPath (Split-Path $task) -TaskName (Split-Path $task -Leaf) -ErrorAction SilentlyContinue
}

# 6. Disable Windows Defender (Basic Registry Method)
reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows Defender&quot; /v DisableAntiSpyware /t REG_DWORD /d 1 /f
reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection&quot; /v DisableRealtimeMonitoring /t REG_DWORD /d 1 /f
reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection&quot; /v DisableBehaviorMonitoring /t REG_DWORD /d 1 /f

# 7. Disable System Intelligence, AI, and Copilot Features
# Disable Copilot
reg.exe add &quot;HKCU\Software\Policies\Microsoft\Windows\WindowsCopilot&quot; /v TurnOffWindowsCopilot /t REG_DWORD /d 1 /f
reg.exe add &quot;HKLM\Software\Policies\Microsoft\Windows\WindowsCopilot&quot; /v TurnOffWindowsCopilot /t REG_DWORD /d 1 /f

# Disable Recall (Windows 11 24H2+)
reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsAI&quot; /v DisableRecall /t REG_DWORD /d 1 /f
reg.exe add &quot;HKCU\SOFTWARE\Policies\Microsoft\Windows\WindowsAI&quot; /v DisableRecall /t REG_DWORD /d 1 /f

# Disable SmartScreen for Edge and Windows
reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\System&quot; /v EnableSmartScreen /t REG_DWORD /d 0 /f
reg.exe add &quot;HKCU\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter&quot; /v EnabledV9 /t REG_DWORD /d 0 /f

# Disable Windows Ink Workspace
reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace&quot; /v AllowWindowsInkWorkspace /t REG_DWORD /d 0 /f

# Disable Typing Insights and Auto-Correction (AI typing features)
reg.exe add &quot;HKCU\Software\Microsoft\Input\Settings&quot; /v &quot;MultilingualEnabled&quot; /t REG_DWORD /d 0 /f
reg.exe add &quot;HKCU\Software\Microsoft\Input\TIPC&quot; /v &quot;Enabled&quot; /t REG_DWORD /d 0 /f

# Disable Taskbar Web Search (Prevents Bing AI web results)
reg.exe add &quot;HKCU\Software\Policies\Microsoft\Windows\Explorer&quot; /v DisableSearchBoxSuggestions /t REG_DWORD /d 1 /f
reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search&quot; /v DisableWebSearch /t REG_DWORD /d 1 /f

# 8. Disable Core OS Functionality (Extreme Minimalist)
# Disable Action Center and Notification Center
reg.exe add &quot;HKCU\Software\Policies\Microsoft\Windows\Explorer&quot; /v DisableNotificationCenter /t REG_DWORD /d 1 /f
reg.exe add &quot;HKLM\Software\Policies\Microsoft\Windows\Explorer&quot; /v DisableNotificationCenter /t REG_DWORD /d 1 /f

# Disable User Account Control (UAC) entirely
reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System&quot; /v EnableLUA /t REG_DWORD /d 0 /f

# Disable System Restore
reg.exe add &quot;HKLM\SOFTWARE\Policies\Microsoft\Windows NT\SystemRestore&quot; /v DisableSR /t REG_DWORD /d 1 /f

# Disable Background Intelligent Transfer Service (BITS) &amp; Windows Error Reporting (WER)
Set-Service -Name &quot;BITS&quot; -StartupType Disabled -ErrorAction SilentlyContinue
Set-Service -Name &quot;WerSvc&quot; -StartupType Disabled -ErrorAction SilentlyContinue

# Disable Windows Update Orchestrator Service
Set-Service -Name &quot;UsoSvc&quot; -StartupType Disabled -ErrorAction SilentlyContinue

# Remove Edge Remnants
reg.exe add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer&quot; /v DisableEdgeDesktopShortcutCreation /t REG_DWORD /d 1 /f
Get-ScheduledTask -TaskName &quot;*EdgeUpdate*&quot; -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$false

# 9. Ultimate Microsoft Appx Purge
Write-Host &quot;Purging all non-essential Microsoft apps...&quot;
Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -match &quot;Microsoft&quot; -and $_.DisplayName -notmatch &quot;DesktopAppInstaller|SecHealthUI|VCLibs|UI.Xaml|Store|Native&quot; } | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers | Where-Object { $_.Name -match &quot;Microsoft&quot; -and $_.NonRemovable -eq $false } | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue

Write-Host &quot;Extreme Debloat Completed.&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Tasks\Apply_Clean_Tasks_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Clean Tasks Profile (Tweaks/Tasks/Apply_Clean_Tasks_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY CLEAN TASKS PROFILE&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile disables background telemetry scheduled tasks.&quot;
Write-Host &quot;It prevents Microsoft&apos;s Customer Experience Improvement Program&quot;
Write-Host &quot;and compatibility appraisers from consuming CPU in the background.&quot;
Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Tasks&quot; -Action &quot;Aborted Clean Tasks Profile Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Tasks&quot; -Action &quot;Starting Master Clean Tasks Orchestrator&quot; -Level WARNING

$ScriptDir = $PSScriptRoot

Write-Host &quot;`n[1/1] Disabling Telemetry Scheduled Tasks...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Telemetry_Tasks.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Tasks&quot; -Action &quot;Completed Master Clean Tasks Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Clean Tasks Profile deployment complete!&quot; -ForegroundColor Green
if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Tasks\Disable_Telemetry_Tasks.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Telemetry Tasks (Tweaks/Tasks/Disable_Telemetry_Tasks.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Tasks&quot; -Action &quot;Initiating Telemetry Tasks Disablement&quot;

# Array of known heavy telemetry/CEIP tasks
$TelemetryTasks = @(
    &quot;\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser&quot;,
    &quot;\Microsoft\Windows\Application Experience\ProgramDataUpdater&quot;,
    &quot;\Microsoft\Windows\Application Experience\StartupAppTask&quot;,
    &quot;\Microsoft\Windows\Customer Experience Improvement Program\Consolidator&quot;,
    &quot;\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip&quot;
)

$DisabledCount = 0

foreach ($TaskPath in $TelemetryTasks) {
    $Task = Get-ScheduledTask -TaskPath ($TaskPath | Split-Path -Parent) -TaskName ($TaskPath | Split-Path -Leaf) -ErrorAction SilentlyContinue
    
    if ($Task) {
        $CurrentState = $Task.State
        
        if ($CurrentState -ne &quot;Disabled&quot;) {
            Disable-ScheduledTask -TaskPath ($TaskPath | Split-Path -Parent) -TaskName ($TaskPath | Split-Path -Leaf) | Out-Null
            Write-FrameworkLog -ModuleName &quot;Tasks&quot; -Action &quot;Disabled Task: $TaskPath&quot; -OldValue $CurrentState -NewValue &quot;Disabled&quot;
            $DisabledCount++
        }
    }
}

Write-Host &quot;`n[SUCCESS] Successfully disabled $DisabledCount background telemetry tasks.&quot; -ForegroundColor Green
Write-Host &quot;This will reduce background CPU spikes and disk I/O.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Troubleshooting\Interactive_Clean_Boot_Manager.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# ==============================================================================
# SCRIPT: Clean Boot &amp; Troubleshooting Manager
# TARGET SYSTEM: Windows 10 &amp; Windows 11
# DESCRIPTION: Diagnoses and isolates background app and service conflicts.
#              Saves the original state of all running third-party (non-Microsoft)
#              services and startup apps to a JSON file (boot_profile.json),
#              then safely disables them for troubleshooting.
#              A simple restore function returns the system to its exact original state.
# SAFETY LEVEL: Advanced, Fully Reversible and Safe
# ==============================================================================

$Host.UI.RawUI.WindowTitle = &quot;Windows Clean Boot Manager&quot;

$ProfileFile = Join-Path $PSScriptRoot &quot;boot_profile.json&quot;

# Startup Registry &amp; Folders Paths (For Startup App backup)
$HKCU_Run = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\Run&quot;
$HKCU_RunDisabled = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\Run-Disabled&quot;
$HKLM_Run = &quot;HKLM:\Software\Microsoft\Windows\CurrentVersion\Run&quot;
$HKLM_RunDisabled = &quot;HKLM:\Software\Microsoft\Windows\CurrentVersion\Run-Disabled&quot;
$HKLM_Wow_Run = &quot;HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Run&quot;
$HKLM_Wow_RunDisabled = &quot;HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Run-Disabled&quot;
$UserStartupDir = &quot;$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup&quot;
$UserStartupDisabledDir = &quot;$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup-Disabled&quot;
$CommonStartupDir = &quot;$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Startup&quot;
$CommonStartupDisabledDir = &quot;$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Startup-Disabled&quot;

# Ensure backup paths exist
function Ensure-Paths {
    if (-not (Test-Path $HKCU_RunDisabled)) { New-Item -Path $HKCU_RunDisabled -Force | Out-Null }
    if (-not (Test-Path $HKLM_RunDisabled)) { New-Item -Path $HKLM_RunDisabled -Force | Out-Null }
    if (-not (Test-Path $HKLM_Wow_RunDisabled)) { New-Item -Path $HKLM_Wow_RunDisabled -Force | Out-Null }
    if (-not (Test-Path $UserStartupDisabledDir)) { New-Item -Path $UserStartupDisabledDir -ItemType Directory -Force | Out-Null }
    if (-not (Test-Path $CommonStartupDisabledDir)) { New-Item -Path $CommonStartupDisabledDir -ItemType Directory -Force | Out-Null }
}

function Clear-Console {
    Clear-Host
    Write-Host &quot;======================================================================&quot; -ForegroundColor Cyan
    Write-Host &quot;                    WINDOWS CLEAN BOOT &amp; TROUBLESHOOT MANAGER         &quot; -ForegroundColor Cyan
    Write-Host &quot;======================================================================&quot; -ForegroundColor Cyan
    Write-Host &quot;&quot;
}

# Check Admin Rights
$identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$principal = New-Object System.Security.Principal.WindowsPrincipal($identity)
$isAdmin = $principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)

if (-not $isAdmin) {
    Clear-Console
    Write-Host &quot;[!] ERROR: This script must be run as an Administrator.&quot; -ForegroundColor Red
    Write-Host &quot;    Right-click your PowerShell window and select &apos;Run as Administrator&apos;.&quot; -ForegroundColor Yellow
    Write-Host &quot;&quot;
    Read-Host &quot;Press Enter to exit...&quot;
    exit
}

while ($true) {
    Clear-Console
    $hasBackup = Test-Path $ProfileFile
    
    if ($hasBackup) {
        Write-Host &quot;[!] SYSTEM STATUS: Currently in a Clean Boot / Troubleshoot state.&quot; -ForegroundColor Yellow
        Write-Host &quot;    Original system boot configuration is saved in: boot_profile.json&quot; -ForegroundColor Gray
    } else {
        Write-Host &quot;[*] SYSTEM STATUS: Normal Boot (All third-party items active)&quot; -ForegroundColor Green
    }
    Write-Host &quot;&quot;

    Write-Host &quot;Choose an option:&quot; -ForegroundColor White
    Write-Host &quot;  1. Apply Clean Boot (Saves states, disables 3rd-party services &amp; startup apps)&quot; -ForegroundColor Green
    Write-Host &quot;  2. Restore Normal Boot (Re-enables all services &amp; startup apps to original state)&quot; -ForegroundColor Yellow
    Write-Host &quot;  3. Exit&quot; -ForegroundColor Red
    Write-Host &quot;&quot;

    $choice = Read-Host &quot;Option (1-3)&quot;

    switch ($choice) {
        &quot;1&quot; {
            if ($hasBackup) {
                Write-Host &quot;&quot;
                Write-Host &quot;[!] Already in a clean boot state! Please restore normal boot first.&quot; -ForegroundColor Red
                Start-Sleep -Seconds 2
                continue
            }

            Ensure-Paths
            Clear-Console
            Write-Host &quot;Starting Clean Boot analysis...&quot; -ForegroundColor Cyan
            Write-Host &quot;&quot;

            # 1. Fetch Third-Party Services
            Write-Host &quot;[*] Identifying third-party services...&quot; -ForegroundColor Gray
            $services = Get-CimInstance Win32_Service | Where-Object { 
                $_.PathName -notlike &quot;*Windows*&quot; -and 
                $_.PathName -notlike &quot;*Microsoft*&quot; -and 
                $_.StartMode -ne &quot;Disabled&quot; 
            }

            Write-Host &quot;    Found $($services.Count) active third-party services.&quot; -ForegroundColor Gray

            # 2. Fetch Active Startup Apps
            Write-Host &quot;[*] Identifying active startup items...&quot; -ForegroundColor Gray
            $startupApps = @()
            
            # HKCU Run
            $props = Get-Item -Path $HKCU_Run | Select-Object -ExpandProperty Property -ErrorAction SilentlyContinue
            foreach ($p in $props) {
                $val = (Get-ItemProperty -Path $HKCU_Run -Name $p).$p
                $startupApps += @{ Name = $p; Value = $val; Source = &quot;HKCU_Run&quot; }
            }
            # HKLM Run
            $props = Get-Item -Path $HKLM_Run | Select-Object -ExpandProperty Property -ErrorAction SilentlyContinue
            foreach ($p in $props) {
                $val = (Get-ItemProperty -Path $HKLM_Run -Name $p).$p
                $startupApps += @{ Name = $p; Value = $val; Source = &quot;HKLM_Run&quot; }
            }
            # HKLM Wow
            $props = Get-Item -Path $HKLM_Wow_Run | Select-Object -ExpandProperty Property -ErrorAction SilentlyContinue
            foreach ($p in $props) {
                $val = (Get-ItemProperty -Path $HKLM_Wow_Run -Name $p).$p
                $startupApps += @{ Name = $p; Value = $val; Source = &quot;HKLM_Wow_Run&quot; }
            }
            # Folders
            if (Test-Path $UserStartupDir) {
                Get-ChildItem -Path $UserStartupDir -Filter &quot;*.lnk&quot; | ForEach-Object {
                    $startupApps += @{ Name = $_.Name; Value = $_.FullName; Source = &quot;UserStartupFolder&quot; }
                }
            }
            if (Test-Path $CommonStartupDir) {
                Get-ChildItem -Path $CommonStartupDir -Filter &quot;*.lnk&quot; | ForEach-Object {
                    $startupApps += @{ Name = $_.Name; Value = $_.FullName; Source = &quot;CommonStartupFolder&quot; }
                }
            }

            Write-Host &quot;    Found $($startupApps.Count) active startup items.&quot; -ForegroundColor Gray
            Write-Host &quot;&quot;

            $confirm = Read-Host &quot;Proceed with disabling these items for troubleshooting? (y/n)&quot;
            if ($confirm -ne &quot;y&quot;) { continue }

            # Prepare Backup Payload
            $backupData = @{
                Services = @()
                StartupApps = $startupApps
            }

            foreach ($srv in $services) {
                $backupData.Services += @{
                    Name = $srv.Name
                    DisplayName = $srv.DisplayName
                    StartMode = $srv.StartMode
                }
            }

            # Write Backup File
            try {
                $backupData | ConvertTo-Json -Depth 5 | Out-File -FilePath $ProfileFile -Force
                Write-Host &quot;&quot;
                Write-Host &quot;[+] Original system boot profile successfully backed up to boot_profile.json!&quot; -ForegroundColor Green
            } catch {
                Write-Host &quot;[!] Error writing boot backup profile. Aborting Clean Boot.&quot; -ForegroundColor Red
                Start-Sleep -Seconds 3
                continue
            }

            # 3. Apply Clean Boot (Disable Items)
            Write-Host &quot;&quot;
            Write-Host &quot;[*] Disabling third-party services...&quot; -ForegroundColor Yellow
            foreach ($srv in $services) {
                try {
                    Set-Service -Name $srv.Name -StartupType Disabled -ErrorAction Stop
                    Stop-Service -Name $srv.Name -Force -ErrorAction SilentlyContinue
                } catch {
                    Write-Host &quot;    [!] Could not disable service: $($srv.Name)&quot; -ForegroundColor DarkGray
                }
            }

            Write-Host &quot;[*] Disabling startup applications...&quot; -ForegroundColor Yellow
            foreach ($app in $startupApps) {
                try {
                    switch ($app.Source) {
                        &quot;HKCU_Run&quot; {
                            Set-ItemProperty -Path $HKCU_RunDisabled -Name $app.Name -Value $app.Value -Force | Out-Null
                            Remove-ItemProperty -Path $HKCU_Run -Name $app.Name -Force | Out-Null
                        }
                        &quot;HKLM_Run&quot; {
                            Set-ItemProperty -Path $HKLM_RunDisabled -Name $app.Name -Value $app.Value -Force | Out-Null
                            Remove-ItemProperty -Path $HKLM_Run -Name $app.Name -Force | Out-Null
                        }
                        &quot;HKLM_Wow_Run&quot; {
                            Set-ItemProperty -Path $HKLM_Wow_RunDisabled -Name $app.Name -Value $app.Value -Force | Out-Null
                            Remove-ItemProperty -Path $HKLM_Wow_Run -Name $app.Name -Force | Out-Null
                        }
                        &quot;UserStartupFolder&quot; {
                            Move-Item -Path $app.Value -Destination (Join-Path $UserStartupDisabledDir $app.Name) -Force | Out-Null
                        }
                        &quot;CommonStartupFolder&quot; {
                            Move-Item -Path $app.Value -Destination (Join-Path $CommonStartupDisabledDir $app.Name) -Force | Out-Null
                        }
                    }
                } catch {
                    Write-Host &quot;    [!] Could not disable startup app: $($app.Name)&quot; -ForegroundColor DarkGray
                }
            }

            Write-Host &quot;&quot;
            Write-Host &quot;======================================================================&quot; -ForegroundColor Green
            Write-Host &quot;                    CLEAN BOOT CONFIGURATION APPLIED                  &quot; -ForegroundColor Green
            Write-Host &quot;======================================================================&quot; -ForegroundColor Green
            Write-Host &quot; [!] Success! Third-party services and startup apps have been disabled.&quot; -ForegroundColor Green
            Write-Host &quot; [!] IMPORTANT: Please RESTART your computer now to isolate issues.&quot; -ForegroundColor Yellow
            Write-Host &quot; ======================================================================&quot; -ForegroundColor Green
            Write-Host &quot;&quot;
            Read-Host &quot;Press Enter to return to main menu...&quot;
        }

        &quot;2&quot; {
            if (-not $hasBackup) {
                Write-Host &quot;&quot;
                Write-Host &quot;[!] No backup file found. Your system is already in Normal Boot state.&quot; -ForegroundColor Red
                Start-Sleep -Seconds 2
                continue
            }

            Clear-Console
            Write-Host &quot;Restoring Normal Boot configuration...&quot; -ForegroundColor Cyan
            Write-Host &quot;&quot;

            # Load Backup File
            try {
                $backupData = Get-Content -Raw -Path $ProfileFile | ConvertFrom-Json
            } catch {
                Write-Host &quot;[!] Error loading boot_profile.json. Backup file might be corrupt.&quot; -ForegroundColor Red
                Read-Host &quot;Press Enter to return...&quot;
                continue
            }

            # 1. Restore Services
            Write-Host &quot;[*] Restoring original third-party services states...&quot; -ForegroundColor Yellow
            foreach ($srv in $backupData.Services) {
                # Map StartMode to ServiceStartMode parameter string
                # Win32 StartMode values: Boot, System, Auto, Manual, Disabled
                # Set-Service StartupType values: Automatic, Manual, Disabled, Boot, System
                $mode = $srv.StartMode
                if ($mode -eq &quot;Auto&quot;) { $mode = &quot;Automatic&quot; }
                
                try {
                    Set-Service -Name $srv.Name -StartupType $mode -ErrorAction Stop
                } catch {
                    Write-Host &quot;    [!] Could not restore service: $($srv.Name) to $mode&quot; -ForegroundColor DarkGray
                }
            }

            # 2. Restore Startup Apps
            Write-Host &quot;[*] Restoring startup applications...&quot; -ForegroundColor Yellow
            foreach ($app in $backupData.StartupApps) {
                try {
                    switch ($app.Source) {
                        &quot;HKCU_Run&quot; {
                            Set-ItemProperty -Path $HKCU_Run -Name $app.Name -Value $app.Value -Force | Out-Null
                            Remove-ItemProperty -Path $HKCU_RunDisabled -Name $app.Name -Force | Out-Null
                        }
                        &quot;HKLM_Run&quot; {
                            Set-ItemProperty -Path $HKLM_Run -Name $app.Name -Value $app.Value -Force | Out-Null
                            Remove-ItemProperty -Path $HKLM_RunDisabled -Name $app.Name -Force | Out-Null
                        }
                        &quot;HKLM_Wow_Run&quot; {
                            Set-ItemProperty -Path $HKLM_Wow_Run -Name $app.Name -Value $app.Value -Force | Out-Null
                            Remove-ItemProperty -Path $HKLM_Wow_RunDisabled -Name $app.Name -Force | Out-Null
                        }
                        &quot;UserStartupFolder&quot; {
                            $src = Join-Path $UserStartupDisabledDir $app.Name
                            Move-Item -Path $src -Destination (Join-Path $UserStartupDir $app.Name) -Force | Out-Null
                        }
                        &quot;CommonStartupFolder&quot; {
                            $src = Join-Path $CommonStartupDisabledDir $app.Name
                            Move-Item -Path $src -Destination (Join-Path $CommonStartupDir $app.Name) -Force | Out-Null
                        }
                    }
                } catch {
                    Write-Host &quot;    [!] Could not restore startup app: $($app.Name)&quot; -ForegroundColor DarkGray
                }
            }

            # Delete Backup File
            Remove-Item -Path $ProfileFile -Force | Out-Null

            Write-Host &quot;&quot;
            Write-Host &quot;======================================================================&quot; -ForegroundColor Green
            Write-Host &quot;                    NORMAL BOOT CONFIGURATION RESTORED                 &quot; -ForegroundColor Green
            Write-Host &quot;======================================================================&quot; -ForegroundColor Green
            Write-Host &quot; [+] Success! Your services and startup apps have been restored.&quot; -ForegroundColor Green
            Write-Host &quot; [+] Please RESTART your computer to complete the normal boot restoration.&quot; -ForegroundColor Yellow
            Write-Host &quot; ======================================================================&quot; -ForegroundColor Green
            Write-Host &quot;&quot;
            Read-Host &quot;Press Enter to return to main menu...&quot;
        }

        &quot;3&quot; {
            Write-Host &quot;Exiting...&quot; -ForegroundColor Cyan
            break
        }
    }
}

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Updates\Apply_Update_Control_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Update Control Profile (Tweaks/Updates/Apply_Update_Control_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY UPDATE CONTROL PROFILE&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile restores control over Windows Updates.&quot;
Write-Host &quot;It blocks Windows from automatically overwriting your hardware drivers&quot;
Write-Host &quot;and disables P2P Delivery Optimization to save network bandwidth.&quot;
Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Updates&quot; -Action &quot;Aborted Update Control Profile Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Updates&quot; -Action &quot;Starting Master Update Control Orchestrator&quot; -Level WARNING

$ScriptDir = $PSScriptRoot

Write-Host &quot;`n[1/2] Disabling Automatic Driver Updates...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Automatic_Driver_Updates.ps1&quot;) -Force:$Force

Write-Host &quot;`n[2/2] Disabling Delivery Optimization (P2P)...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Delivery_Optimization.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Updates&quot; -Action &quot;Completed Master Update Control Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Update Control Profile deployment complete!&quot; -ForegroundColor Green
if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Updates\Disable_Automatic_Driver_Updates.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Automatic Driver Updates (Tweaks/Updates/Disable_Automatic_Driver_Updates.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Updates&quot; -Action &quot;Initiating Automatic Driver Updates Disablement&quot;

# 1. Policy: Exclude drivers from Windows Quality Updates
$RegistryPathPolicy = &quot;HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate&quot;
if (-not (Test-Path $RegistryPathPolicy)) { New-Item -Path $RegistryPathPolicy -Force | Out-Null }

$NamePolicy = &quot;ExcludeWUDriversInQualityUpdate&quot;
$CurrentPolicy = (Get-ItemProperty -Path $RegistryPathPolicy -Name $NamePolicy -ErrorAction SilentlyContinue).$NamePolicy
if ($null -eq $CurrentPolicy) { $CurrentPolicy = &quot;Not_Set&quot; }

Set-ItemProperty -Path $RegistryPathPolicy -Name $NamePolicy -Value 1 -Type DWord -Force
Write-FrameworkLog -ModuleName &quot;Updates&quot; -Action &quot;Disabled WU Drivers in Quality Updates&quot; -OldValue $CurrentPolicy -NewValue &quot;1&quot;

# 2. Base setting: Driver Searching
$RegistryPathBase = &quot;HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching&quot;
if (-not (Test-Path $RegistryPathBase)) { New-Item -Path $RegistryPathBase -Force | Out-Null }

$NameBase = &quot;SearchOrderConfig&quot;
$CurrentBase = (Get-ItemProperty -Path $RegistryPathBase -Name $NameBase -ErrorAction SilentlyContinue).$NameBase
if ($null -eq $CurrentBase) { $CurrentBase = &quot;Not_Set&quot; }

Set-ItemProperty -Path $RegistryPathBase -Name $NameBase -Value 0 -Type DWord -Force
Write-FrameworkLog -ModuleName &quot;Updates&quot; -Action &quot;Disabled Automatic Driver Searching&quot; -OldValue $CurrentBase -NewValue &quot;0&quot;

Write-Host &quot;`n[SUCCESS] Windows will no longer forcibly update your hardware drivers.&quot; -ForegroundColor Green
Write-Host &quot;This prevents Windows Update from overwriting your custom GPU or Audio drivers.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Updates\Disable_Delivery_Optimization.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Delivery Optimization (Tweaks/Updates/Disable_Delivery_Optimization.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Updates&quot; -Action &quot;Initiating Delivery Optimization Disablement&quot;

# 1. Policy Level
$RegistryPathPolicy = &quot;HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization&quot;
if (-not (Test-Path $RegistryPathPolicy)) { New-Item -Path $RegistryPathPolicy -Force | Out-Null }

$Name = &quot;DODownloadMode&quot;
$CurrentPolicy = (Get-ItemProperty -Path $RegistryPathPolicy -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentPolicy) { $CurrentPolicy = &quot;Not_Set&quot; }

Set-ItemProperty -Path $RegistryPathPolicy -Name $Name -Value 0 -Type DWord -Force
Write-FrameworkLog -ModuleName &quot;Updates&quot; -Action &quot;Disabled Delivery Optimization (Policy)&quot; -OldValue $CurrentPolicy -NewValue &quot;0&quot;

# 2. Base Configuration Level
$RegistryPathBase = &quot;HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config&quot;
if (-not (Test-Path $RegistryPathBase)) { New-Item -Path $RegistryPathBase -Force | Out-Null }

$CurrentBase = (Get-ItemProperty -Path $RegistryPathBase -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentBase) { $CurrentBase = &quot;Not_Set&quot; }

Set-ItemProperty -Path $RegistryPathBase -Name $Name -Value 0 -Type DWord -Force
Write-FrameworkLog -ModuleName &quot;Updates&quot; -Action &quot;Disabled Delivery Optimization (Config)&quot; -OldValue $CurrentBase -NewValue &quot;0&quot;

Write-Host &quot;`n[SUCCESS] Windows Update Delivery Optimization (P2P) has been disabled.&quot; -ForegroundColor Green
Write-Host &quot;Your PC will no longer silently upload Windows updates to other computers on the internet.&quot; -ForegroundColor Yellow


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Visual\Apply_Balanced_Aesthetic_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Balanced Aesthetic Profile (Tweaks/Visual/Apply_Balanced_Aesthetic_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY BALANCED AESTHETIC PROFILE&quot; -ForegroundColor Cyan
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile speeds up Windows by disabling slow animations and menu delays,&quot;
Write-Host &quot;while keeping UI Transparency (Mica/Acrylic) and Font Smoothing intact.&quot;
Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Visual&quot; -Action &quot;Aborted Balanced Aesthetic Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Visual&quot; -Action &quot;Starting Master Balanced Aesthetic Orchestrator&quot; -Level WARNING

$ScriptDir = $PSScriptRoot

Write-Host &quot;`n[1/3] Ensuring UI Transparency is Enabled for aesthetics...&quot; -ForegroundColor Cyan
$RegPathTransp = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize&quot;
Set-ItemProperty -Path $RegPathTransp -Name &quot;EnableTransparency&quot; -Value 1 -Type DWord -Force -ErrorAction SilentlyContinue

Write-Host &quot;`n[2/3] Reducing Menu Show Delay for snappier navigation...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Reduce_Menu_Show_Delay.ps1&quot;) -Force:$Force

Write-Host &quot;`n[3/3] Disabling Unnecessary Taskbar and Window Animations...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Unnecessary_Animations.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Visual&quot; -Action &quot;Completed Master Balanced Aesthetic Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Balanced Aesthetic Profile deployment complete!&quot; -ForegroundColor Green
Write-Host &quot;Restarting Windows Explorer to apply all visual changes immediately...&quot; -ForegroundColor Yellow
Stop-Process -Name &quot;explorer&quot; -Force

if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Visual\Apply_Max_Performance_Profile.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Apply Max Performance Profile (Tweaks/Visual/Apply_Max_Performance_Profile.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-Host &quot;=================================================&quot;
Write-Host &quot;   APPLY MAX PERFORMANCE VISUAL PROFILE&quot; -ForegroundColor Red
Write-Host &quot;=================================================&quot;
Write-Host &quot;This profile strips Windows visuals to the bare minimum to maximize performance.&quot;
Write-Host &quot;It disables transparency, animations, and menu delays.&quot;
Write-Host &quot;(Font Smoothing is intentionally kept enabled so text remains readable).&quot;
Write-Host &quot;Press &apos;Y&apos; to continue or any other key to abort...&quot;
if (-not $Force) { $Confirm = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;).Character } else { $Confirm = &apos;y&apos; }

if ($Confirm -notmatch &apos;y&apos;) {
    Write-FrameworkLog -ModuleName &quot;Visual&quot; -Action &quot;Aborted Max Performance Deployment&quot;
    Write-Host &quot;`nAborted by user.&quot;
    Exit
}

Write-FrameworkLog -ModuleName &quot;Visual&quot; -Action &quot;Starting Master Max Performance Orchestrator&quot; -Level WARNING

$ScriptDir = $PSScriptRoot

Write-Host &quot;`n[1/3] Disabling UI Transparency Effects...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Transparency.ps1&quot;) -Force:$Force

Write-Host &quot;`n[2/3] Reducing Menu Show Delay for snappier navigation...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Reduce_Menu_Show_Delay.ps1&quot;) -Force:$Force

Write-Host &quot;`n[3/3] Disabling Unnecessary Taskbar and Window Animations...&quot; -ForegroundColor Cyan
&amp; (Join-Path -Path $ScriptDir -ChildPath &quot;Disable_Unnecessary_Animations.ps1&quot;) -Force:$Force

Write-FrameworkLog -ModuleName &quot;Visual&quot; -Action &quot;Completed Master Max Performance Orchestrator&quot; -Level WARNING

Write-Host &quot;`n[SUCCESS] Max Performance Visual Profile deployment complete!&quot; -ForegroundColor Green
Write-Host &quot;Restarting Windows Explorer to apply all visual changes immediately...&quot; -ForegroundColor Yellow
Stop-Process -Name &quot;explorer&quot; -Force

if (-not $Force) {
    if (-not $Force) {
    Write-Host &quot;Press any key to exit...&quot;
    if (-not $Force) { $null = $Host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;) }
}

}


    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Visual\Disable_Transparency.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Transparency Effects (Tweaks/Visual/Disable_Transparency.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Visual&quot; -Action &quot;Initiating Transparency Disablement&quot;

$RegistryPath = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize&quot;
$Name = &quot;EnableTransparency&quot;

# 1. Snapshot current state for reversibility
$CurrentValue = (Get-ItemProperty -Path $RegistryPath -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentValue) { $CurrentValue = &quot;Not_Set&quot; }

# 2. Apply Configuration (0 = Disabled, 1 = Enabled)
Set-ItemProperty -Path $RegistryPath -Name $Name -Value 0 -Type DWord -Force

# 3. Log Outcome
Write-FrameworkLog -ModuleName &quot;Visual&quot; -Action &quot;Disabled UI Transparency Effects&quot; -OldValue $CurrentValue -NewValue &quot;0&quot;

Write-Host &quot;`n[SUCCESS] Windows Transparency Effects disabled.&quot; -ForegroundColor Green


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Visual\Disable_Unnecessary_Animations.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Disable Unnecessary Animations (Tweaks/Visual/Disable_Unnecessary_Animations.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Visual&quot; -Action &quot;Initiating UI Animation Disablement&quot;

# 1. Disable Window Minimize/Maximize Animations
$RegPathWindow = &quot;HKCU:\Control Panel\Desktop\WindowMetrics&quot;
$NameWindow = &quot;MinAnimate&quot;

$CurrentValWindow = (Get-ItemProperty -Path $RegPathWindow -Name $NameWindow -ErrorAction SilentlyContinue).$NameWindow
if ($null -eq $CurrentValWindow) { $CurrentValWindow = &quot;Not_Set&quot; }

Set-ItemProperty -Path $RegPathWindow -Name $NameWindow -Value &quot;0&quot; -Type String -Force
Write-FrameworkLog -ModuleName &quot;Visual&quot; -Action &quot;Disabled Window Animations&quot; -OldValue $CurrentValWindow -NewValue &quot;0&quot;

# 2. Disable Taskbar Animations
$RegPathTaskbar = &quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced&quot;
$NameTaskbar = &quot;TaskbarAnimations&quot;

$CurrentValTaskbar = (Get-ItemProperty -Path $RegPathTaskbar -Name $NameTaskbar -ErrorAction SilentlyContinue).$NameTaskbar
if ($null -eq $CurrentValTaskbar) { $CurrentValTaskbar = &quot;Not_Set&quot; }

Set-ItemProperty -Path $RegPathTaskbar -Name $NameTaskbar -Value 0 -Type DWord -Force
Write-FrameworkLog -ModuleName &quot;Visual&quot; -Action &quot;Disabled Taskbar Animations&quot; -OldValue $CurrentValTaskbar -NewValue &quot;0&quot;

Write-Host &quot;`n[SUCCESS] Unnecessary window and taskbar animations disabled.&quot; -ForegroundColor Green


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>
    <File path="C:\Windows\Setup\Scripts\Tweaks\Visual\Reduce_Menu_Show_Delay.ps1">
[CmdletBinding()]
param (
    [switch]$Force
)

# Windows Configuration &amp; Optimization Framework
# Reduce Menu Show Delay (Tweaks/Visual/Reduce_Menu_Show_Delay.ps1)

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning &quot;This script requires Administrator privileges. Please run PowerShell as Admin.&quot;
    Exit
}

$HelpersDir = Join-Path -Path $PSScriptRoot -ChildPath &quot;..\..\Core\Helpers&quot;
Import-Module (Join-Path -Path $HelpersDir -ChildPath &quot;Logging.psm1&quot;) -Force

Write-FrameworkLog -ModuleName &quot;Visual&quot; -Action &quot;Initiating Menu Show Delay Reduction&quot;

$RegistryPath = &quot;HKCU:\Control Panel\Desktop&quot;
$Name = &quot;MenuShowDelay&quot;

# 1. Snapshot current state for reversibility
$CurrentValue = (Get-ItemProperty -Path $RegistryPath -Name $Name -ErrorAction SilentlyContinue).$Name
if ($null -eq $CurrentValue) { $CurrentValue = &quot;Not_Set&quot; }

# 2. Apply Configuration (10ms for fast snapping, default is 400ms)
Set-ItemProperty -Path $RegistryPath -Name $Name -Value &quot;10&quot; -Type String -Force

# 3. Log Outcome
Write-FrameworkLog -ModuleName &quot;Visual&quot; -Action &quot;Reduced Menu Show Delay&quot; -OldValue $CurrentValue -NewValue &quot;10&quot;

Write-Host &quot;`n[SUCCESS] Windows Menu Show Delay reduced for improved responsiveness.&quot; -ForegroundColor Green


$null = Read-Host &quot;Press Enter to exit...&quot;

    </File>

  </Extensions>
</unattend>


