Write-Host "`n===== BLOCK A: Disable telemetry scheduled tasks =====" -ForegroundColor Cyan
$tasksToDisable = @(
"\Microsoft\Windows\Application Experience\MareBackup",
"\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser Exp",
"\Microsoft\Windows\Application Experience\PcaPatchDbTask",
"\Microsoft\Windows\Application Experience\SdbinstMergeDbTask",
"\Microsoft\Windows\Application Experience\StartupAppTask",
"\Microsoft\Windows\Autochk\Proxy",
"\Microsoft\Windows\Customer Experience Improvement Program\Consolidator",
"\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip",
"\Microsoft\Windows\Diagnosis\RecommendedTroubleshootingScanner",
"\Microsoft\Windows\Diagnosis\Scheduled",
"\Microsoft\Windows\Diagnosis\UnexpectedCodepath",
"\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector",
"\Microsoft\Windows\Feedback\Siuf\DmClient",
"\Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload",
"\Microsoft\Windows\Maps\MapsToastTask",
"\Microsoft\Windows\Windows Error Reporting\QueueReporting"
)
foreach ($t in $tasksToDisable) {
$path = (Split-Path $t) + "\"
$name = Split-Path $t -Leaf
try {
Disable-ScheduledTask -TaskPath $path -TaskName $name -ErrorAction Stop | Out-Null
Write-Host "Disabled: $t" -ForegroundColor Green
} catch {
Write-Host "Skipped (not found): $t" -ForegroundColor DarkYellow
}
}
# Also disable Yandex Browser scheduled tasks (keep the browser, kill its tasks)
Write-Host "`n-- Yandex scheduled tasks --" -ForegroundColor Cyan
Get-ScheduledTask | Where-Object { $_.TaskName -match 'Yandex' -or $_.TaskPath -match 'Yandex' } |
ForEach-Object {
try {
Disable-ScheduledTask -TaskPath $_.TaskPath -TaskName $_.TaskName -ErrorAction Stop | Out-Null
Write-Host "Disabled: $($_.TaskPath)$($_.TaskName)" -ForegroundColor Green
} catch {
Write-Host "Failed: $($_.TaskName)" -ForegroundColor Red
}
}
Write-Host "`n===== BLOCK B: Telemetry, DiagTrack, privacy =====" -ForegroundColor Cyan
function Set-Reg($path, $name, $value, $type = "DWord") {
if (-not (Test-Path $path)) { New-Item -Path $path -Force | Out-Null }
New-ItemProperty -Path $path -Name $name -Value $value -PropertyType $type -Force | Out-Null
Write-Host " $path :: $name = $value" -ForegroundColor Gray
}
# --- Telemetry to Security level (0) on Windows 11 Pro ---
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" "AllowTelemetry" 0
Set-Reg "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" "AllowTelemetry" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" "MaxTelemetryAllowed" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" "DoNotShowFeedbackNotifications" 1
# --- CEIP ---
Set-Reg "HKLM:\SOFTWARE\Microsoft\SQMClient\Windows" "CEIPEnable" 0
# --- Application Impact Telemetry / Inventory ---
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat" "AITEnable" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat" "DisableInventory" 1
# --- Suggested content / "Get the most out of Windows" / Silent installs ---
$cdm = "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"
Set-Reg $cdm "ContentDeliveryAllowed" 0
Set-Reg $cdm "OemPreInstalledAppsEnabled" 0
Set-Reg $cdm "PreInstalledAppsEnabled" 0
Set-Reg $cdm "PreInstalledAppsEverEnabled" 0
Set-Reg $cdm "SilentInstalledAppsEnabled" 0
Set-Reg $cdm "SubscribedContent-310093Enabled" 0 # Welcome experience after updates
Set-Reg $cdm "SubscribedContent-338387Enabled" 0 # Lock screen tips
Set-Reg $cdm "SubscribedContent-338388Enabled" 0 # Start menu suggestions
Set-Reg $cdm "SubscribedContent-338389Enabled" 0 # Settings app tips <-- was 1 on your system
Set-Reg $cdm "SubscribedContent-338393Enabled" 0 # Settings suggested content
Set-Reg $cdm "SubscribedContent-353694Enabled" 0 # already 0
Set-Reg $cdm "SubscribedContent-353696Enabled" 0 # already 0
Set-Reg $cdm "SubscribedContent-353698Enabled" 0 # Lock screen suggestions
Set-Reg $cdm "SystemPaneSuggestionsEnabled" 0
Set-Reg $cdm "RotatingLockScreenEnabled" 0
Set-Reg $cdm "RotatingLockScreenOverlayEnabled" 0
Set-Reg $cdm "SoftLandingEnabled" 0
# Disable "Suggestions in Start menu"
Set-Reg "HKCU:\Software\Policies\Microsoft\Windows\CloudContent" "DisableWindowsConsumerFeatures" 1
Set-Reg "HKCU:\Software\Policies\Microsoft\Windows\CloudContent" "DisableSoftLanding" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableWindowsConsumerFeatures" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableCloudOptimizedContent" 1
# --- Advertising ID (already 0, reinforce via policy) ---
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" "DisabledByGroupPolicy" 1
# --- Activity history / Timeline ---
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" "EnableActivityFeed" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" "PublishUserActivities" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" "UploadUserActivities" 0
# --- Tailored experiences with diagnostic data ---
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Privacy" "TailoredExperiencesWithDiagnosticDataEnabled" 0
# --- Start menu / taskbar: disable web search in Start, Bing, Copilot nags ---
Set-Reg "HKCU:\Software\Policies\Microsoft\Windows\Explorer" "DisableSearchBoxSuggestions" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" "DisableWebSearch" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" "ConnectedSearchUseWeb" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" "AllowCortana" 0
# --- Disable Widgets (news & interests) ---
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Dsh" "AllowNewsAndInterests" 0
# --- Error reporting ---
Set-Reg "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" "Disabled" 1
# --- Delivery Optimization: only from LAN, not seed to internet ---
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" "DODownloadMode" 1
# --- DiagTrack service (Connected User Experiences and Telemetry) ---
Write-Host "`n-- Stopping & disabling DiagTrack --" -ForegroundColor Cyan
Stop-Service -Name DiagTrack -Force -ErrorAction SilentlyContinue
Set-Service -Name DiagTrack -StartupType Disabled
Write-Host "DiagTrack stopped & disabled." -ForegroundColor Green
# --- dmwappushservice (WAP push messaging, telemetry-adjacent) ---
Stop-Service -Name dmwappushservice -Force -ErrorAction SilentlyContinue
Set-Service -Name dmwappushservice -StartupType Disabled -ErrorAction SilentlyContinue
Write-Host "dmwappushservice stopped & disabled." -ForegroundColor Green
Write-Host "`n===== BLOCK B COMPLETE =====" -ForegroundColor Green
Write-Host "Telemetry policies applied, DiagTrack disabled, suggested content killed." -ForegroundColor Green
Write-Host "`n===== BLOCK C: Remove AppX bloat =====" -ForegroundColor Cyan
$appsToRemove = @(
"Microsoft.MicrosoftSolitaireCollection", # Solitaire
"Microsoft.XboxGamingOverlay", # Xbox Game Bar
"Microsoft.XboxGameCallableUI",
"Microsoft.XboxSpeechToTextOverlay",
"Microsoft.Xbox.TCUI",
"Microsoft.XboxIdentityProvider",
"Microsoft.GamingApp", # Xbox app (provisioned)
"Microsoft.BingNews",
"Microsoft.BingSearch",
"Microsoft.BingWeather", # bonus: same family, provisioned
"Microsoft.ZuneMusic", # Media Player (old name)
"Microsoft.GetHelp",
"Microsoft.Todos",
"Microsoft.OneDriveSync", # AppX stub only; classic OneDrive handled in Block D
"MicrosoftWindows.Client.WebExperience", # Widgets
"MicrosoftCorporationII.QuickAssist",
"Microsoft.WindowsFeedbackHub",
"Microsoft.MicrosoftOfficeHub", # "Get Office" ad tile
"Microsoft.MicrosoftStickyNotes",
"Microsoft.WindowsAlarms",
"Microsoft.YourPhone", # Phone Link (you didn't list, but commonly removed — REMOVE from this array if you want to keep)
"MicrosoftWindows.CrossDevice" # cross-device Phone Link companion
)
foreach ($app in $appsToRemove) {
Write-Host "`n-- $app --" -ForegroundColor Cyan
# Remove for current user
Get-AppxPackage -Name $app -ErrorAction SilentlyContinue | ForEach-Object {
try {
Remove-AppxPackage -Package $_.PackageFullName -ErrorAction Stop
Write-Host " Removed (user): $($_.PackageFullName)" -ForegroundColor Green
} catch {
Write-Host " Failed (user): $_" -ForegroundColor Red
}
}
# Remove for all users
Get-AppxPackage -Name $app -AllUsers -ErrorAction SilentlyContinue | ForEach-Object {
try {
Remove-AppxPackage -Package $_.PackageFullName -AllUsers -ErrorAction Stop
Write-Host " Removed (all users): $($_.PackageFullName)" -ForegroundColor Green
} catch {
Write-Host " Failed (all users): $_" -ForegroundColor DarkYellow
}
}
# Remove provisioned (prevents reinstall on new accounts / feature updates)
Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -eq $app } | ForEach-Object {
try {
Remove-AppxProvisionedPackage -Online -PackageName $_.PackageName -ErrorAction Stop | Out-Null
Write-Host " Removed (provisioned): $($_.PackageName)" -ForegroundColor Green
} catch {
Write-Host " Failed (provisioned): $_" -ForegroundColor Red
}
}
}
Write-Host "`n===== BLOCK C COMPLETE =====" -ForegroundColor Green
Write-Host "`n===== BLOCK D: OneDrive + startup cleanup =====" -ForegroundColor Cyan
# --- Stop OneDrive ---
taskkill /f /im OneDrive.exe 2>$null
# --- Uninstall classic OneDrive (handles both x64 and x86 installers) ---
$oneDriveSetup = @(
"$env:SystemRoot\System32\OneDriveSetup.exe",
"$env:SystemRoot\SysWOW64\OneDriveSetup.exe"
)
foreach ($exe in $oneDriveSetup) {
if (Test-Path $exe) {
Write-Host "Uninstalling via $exe" -ForegroundColor Cyan
Start-Process -FilePath $exe -ArgumentList "/uninstall" -Wait -NoNewWindow
}
}
# --- Remove leftover OneDrive folders (safe: only the empty shells) ---
$oneDrivePaths = @(
"$env:USERPROFILE\OneDrive",
"$env:LOCALAPPDATA\Microsoft\OneDrive",
"$env:PROGRAMDATA\Microsoft OneDrive",
"$env:SystemDrive\OneDriveTemp"
)
foreach ($p in $oneDrivePaths) {
if (Test-Path $p) {
try {
# Only delete if empty or contains only OneDrive's own leftovers
$items = Get-ChildItem -Path $p -Force -ErrorAction SilentlyContinue
if ($items.Count -eq 0) {
Remove-Item -Path $p -Recurse -Force -ErrorAction Stop
Write-Host "Removed empty: $p" -ForegroundColor Green
} else {
Write-Host "Kept (not empty — check manually): $p" -ForegroundColor DarkYellow
}
} catch {
Write-Host "Failed to remove: $p — $_" -ForegroundColor Red
}
}
}
# --- Remove OneDriveSetup autorun entries for all user hives (per Phase 1 report [1]) ---
Write-Host "`n-- Removing OneDriveSetup Run entries from all user hives --" -ForegroundColor Cyan
$hivePaths = @(
"HKCU:\Software\Microsoft\Windows\CurrentVersion\Run",
"HKLM:\Software\Microsoft\Windows\CurrentVersion\Run",
"HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Run"
)
foreach ($h in $hivePaths) {
if (Test-Path $h) {
Remove-ItemProperty -Path $h -Name "OneDriveSetup" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $h -Name "OneDrive" -ErrorAction SilentlyContinue
}
}
# Also purge OneDriveSetup from the default user hive (so new profiles don't get it)
reg load "HKU\DefaultUser" "C:\Users\Default\NTUSER.DAT" 2>$null
reg delete "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Run" /v "OneDriveSetup" /f 2>$null
reg unload "HKU\DefaultUser" 2>$null
# --- Disable Logitech Download Assistant startup (keeps your mouse/keyboard working) ---
Write-Host "`n-- Disabling Logitech Download Assistant --" -ForegroundColor Cyan
Remove-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run" -Name "Logitech Download Assistant" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Run" -Name "Logitech Download Assistant" -ErrorAction SilentlyContinue
# Also disable the scheduled task that recreates it
Get-ScheduledTask | Where-Object { $_.TaskName -match 'Logitech' } | ForEach-Object {
try {
Disable-ScheduledTask -TaskPath $_.TaskPath -TaskName $_.TaskName -ErrorAction Stop | Out-Null
Write-Host "Disabled task: $($_.TaskPath)$($_.TaskName)" -ForegroundColor Green
} catch {}
}
# --- Prevent OneDrive from reinstalling via feature updates ---
if (-not (Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Force | Out-Null
}
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" "DisableFileSyncNGSC" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" "DisableFileSync" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" "PreventNetworkTrafficPreUserSignIn" 1
# --- Disable OneDrive scheduled tasks if any exist ---
Get-ScheduledTask | Where-Object { $_.TaskName -match 'OneDrive' } | ForEach-Object {
try {
Disable-ScheduledTask -TaskPath $_.TaskPath -TaskName $_.TaskName -ErrorAction Stop | Out-Null
Write-Host "Disabled task: $($_.TaskPath)$($_.TaskName)" -ForegroundColor Green
} catch {}
}
Write-Host "`n===== BLOCK D COMPLETE =====" -ForegroundColor Green
Write-Host "`n===== BLOCK E: Performance, battery, cleanup =====" -ForegroundColor Cyan
# --- Fix the energy-report finding: enable USB selective suspend on both AC and DC ---
# SUB_USB GUID = 2a737441-1930-4402-8d77-b2bebba308a3
# USBSELECTIVESUSPEND GUID = 48e6b7a6-50f5-4782-a5d4-53bb8f07e226
Write-Host "`n-- USB Selective Suspend (raw GUIDs) --" -ForegroundColor Yellow
powercfg /setacvalueindex SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 1
powercfg /setdcvalueindex SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 1
powercfg /setactive SCHEME_CURRENT
Write-Host "USB selective suspend enabled on AC and DC." -ForegroundColor Green
# Verify
powercfg /query SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226
# --- PCI Express link state power management: max savings on battery, moderate on AC ---
powercfg /setacvalueindex SCHEME_CURRENT SUB_PCIEXPRESS ASPM 1 # moderate
powercfg /setdcvalueindex SCHEME_CURRENT SUB_PCIEXPRESS ASPM 2 # max savings
# --- Wireless adapter power saving: max on battery, low on AC ---
# Setting GUID: 12bbebe6-58d6-4636-95bb-3217ef867c1a (Power Saving Mode)
# 0=Max Perf, 1=Low, 2=Medium, 3=Max Savings
powercfg /setacvalueindex SCHEME_CURRENT SUB_WIRELESS 12bbebe6-58d6-4636-95bb-3217ef867c1a 1
powercfg /setdcvalueindex SCHEME_CURRENT SUB_WIRELESS 12bbebe6-58d6-4636-95bb-3217ef867c1a 3
# --- Hard disk idle timeout (applies to NVMe too) ---
# AC: 20 min, Battery: 5 min
powercfg /setacvalueindex SCHEME_CURRENT SUB_DISK DISKIDLE 1200
powercfg /setdcvalueindex SCHEME_CURRENT SUB_DISK DISKIDLE 300
# --- Display timeouts (minutes) ---
powercfg /change monitor-timeout-ac 15
powercfg /change monitor-timeout-dc 5
# --- Sleep timeouts (minutes) ---
powercfg /change standby-timeout-ac 30
powercfg /change standby-timeout-dc 10
# --- Processor power management: slightly more conservative on battery ---
# Min state: AC=5%, Battery=5% (unchanged, already good per your Phase 1 report)
# Max state: AC=100%, Battery=99% (tiny cap avoids turbo-boost spikes on battery = much better thermals/runtime)
powercfg /setacvalueindex SCHEME_CURRENT SUB_PROCESSOR PROCTHROTTLEMAX 100
powercfg /setdcvalueindex SCHEME_CURRENT SUB_PROCESSOR PROCTHROTTLEMAX 99
# --- Apply the changes ---
powercfg /setactive SCHEME_CURRENT
Write-Host "Power plan tuned." -ForegroundColor Green
# --- Disable wake timers on battery (stops random wakeups draining battery in bag) ---
powercfg /setdcvalueindex SCHEME_CURRENT SUB_SLEEP RTCWAKE 0
powercfg /setactive SCHEME_CURRENT
# --- Visual effects: "Best performance" leaning, but keep font smoothing & thumbnails ---
# VisualFXSetting: 1=Best appearance, 2=Best performance, 3=Custom
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" "VisualFXSetting" 3
# Keep these ON:
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "ListviewShadow" 1
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "IconsOnly" 0 # show thumbnails
# Disable animations that eat battery:
$mask = (Get-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask").UserPreferencesMask
# 0x90,0x12,0x03,0x80 = minimum animations (keep smooth scrolling & font smoothing off heavy effects)
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask" -Value ([byte[]](0x90,0x12,0x03,0x80,0x10,0x00,0x00,0x00))
# Disable "Animate windows when minimizing and maximizing"
Set-Reg "HKCU:\Control Panel\Desktop\WindowMetrics" "MinAnimate" "0" "String"
# Disable taskbar animations
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "TaskbarAnimations" 0
# --- File Explorer: show extensions, hidden files (QoL, no perf impact) ---
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "HideFileExt" 0
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Hidden" 1
# --- Light disk cleanup: Windows Update cache, temp files, old prefetch ---
Write-Host "`n-- Disk cleanup --" -ForegroundColor Cyan
Stop-Service -Name wuauserv -Force -ErrorAction SilentlyContinue
Remove-Item "$env:SystemRoot\SoftwareDistribution\Download\*" -Recurse -Force -ErrorAction SilentlyContinue
Start-Service -Name wuauserv -ErrorAction SilentlyContinue
Remove-Item "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$env:SystemRoot\Temp\*" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$env:SystemRoot\Prefetch\*" -Recurse -Force -ErrorAction SilentlyContinue
# --- Component store cleanup (resets the recoverable baseline; can shrink WinSxS) ---
Write-Host "`n-- DISM component store cleanup (may take a few minutes) --" -ForegroundColor Cyan
DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase
# --- Empty Recycle Bin on all drives ---
Write-Host "`n-- Emptying Recycle Bin --" -ForegroundColor Cyan
Clear-RecycleBin -Force -ErrorAction SilentlyContinue
# --- TRIM / ReTrim the SSD (your Samsung NVMe benefits from this) ---
Write-Host "`n-- Running TRIM on C: --" -ForegroundColor Cyan
Optimize-Volume -DriveLetter C -ReTrim -Verbose
# --- Restart Explorer so visual effects / File Explorer tweaks take effect ---
Write-Host "`n-- Restarting Explorer --" -ForegroundColor Cyan
Stop-Process -Name explorer -Force -ErrorAction SilentlyContinue
Start-Sleep -Seconds 2
Start-Process explorer
Write-Host "`n===== BLOCK E COMPLETE =====" -ForegroundColor Green
Write-Host "`n===== VERIFICATION =====" -ForegroundColor Cyan
Write-Host "`n-- Telemetry --" -ForegroundColor Yellow
Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -ErrorAction SilentlyContinue | Select-Object AllowTelemetry, MaxTelemetryAllowed
Write-Host "`n-- DiagTrack service --" -ForegroundColor Yellow
Get-Service DiagTrack, dmwappushservice -ErrorAction SilentlyContinue | Select-Object Name, Status, StartType
Write-Host "`n-- Suggested content (should all be 0) --" -ForegroundColor Yellow
Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" | Select-Object SilentInstalledAppsEnabled, "SubscribedContent-338388Enabled", "SubscribedContent-338389Enabled", SystemPaneSuggestionsEnabled
Write-Host "`n-- Telemetry tasks (should be Disabled) --" -ForegroundColor Yellow
Get-ScheduledTask | Where-Object { $_.TaskPath -match 'Customer Experience|Application Experience|Autochk|DiskDiagnostic|Feedback|Maps|Windows Error Reporting|Diagnosis|Yandex' } | Select-Object TaskName, TaskPath, State | Format-Table -AutoSize
Write-Host "`n-- Removed AppX packages (these should all return nothing) --" -ForegroundColor Yellow
$removed = @("Microsoft.MicrosoftSolitaireCollection","Microsoft.XboxGamingOverlay","Microsoft.BingNews","Microsoft.BingSearch","Microsoft.ZuneMusic","Microsoft.GetHelp","Microsoft.Todos","Microsoft.OneDriveSync","MicrosoftWindows.Client.WebExperience","MicrosoftCorporationII.QuickAssist","Microsoft.WindowsFeedbackHub","Microsoft.MicrosoftOfficeHub","Microsoft.MicrosoftStickyNotes","Microsoft.WindowsAlarms")
foreach ($app in $removed) {
$found = Get-AppxPackage -Name $app -AllUsers -ErrorAction SilentlyContinue
if ($found) {
Write-Host "STILL PRESENT: $app" -ForegroundColor Red
} else {
Write-Host "Gone: $app" -ForegroundColor Green
}
}
Write-Host "`n-- Startup Run keys --" -ForegroundColor Yellow
Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Run" -ErrorAction SilentlyContinue
Get-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run" -ErrorAction SilentlyContinue
Write-Host "`n-- OneDrive leftovers --" -ForegroundColor Yellow
Test-Path "$env:LOCALAPPDATA\Microsoft\OneDrive"
Get-Process OneDrive -ErrorAction SilentlyContinue
Write-Host "`n-- Active power plan settings --" -ForegroundColor Yellow
powercfg /query SCHEME_CURRENT SUB_PROCESSOR PROCTHROTTLEMAX
powercfg /query SCHEME_CURRENT SUB_USB USBSELECTIVESUSPEND
Write-Host "`n-- Disk free space --" -ForegroundColor Yellow
Get-Volume -DriveLetter C | Select-Object DriveLetter, @{N='FreeGB';E={[math]::Round($_.SizeRemaining/1GB,1)}}, @{N='TotalGB';E={[math]::Round($_.Size/1GB,1)}}
Write-Host "`n===== VERIFICATION COMPLETE =====" -ForegroundColor Green
# --- Disable Fast Startup ---
Write-Host "`n-- Disabling Fast Startup --" -ForegroundColor Yellow
Set-Reg "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power" "HiberbootEnabled" 0
Write-Host "Fast Startup disabled." -ForegroundColor Green
# --- Disable Hibernation (removes hiberfil.sys, frees ~13 GB) ---
Write-Host "`n-- Disabling Hibernation --" -ForegroundColor Yellow
powercfg /hibernate off
Write-Host "Hibernation disabled." -ForegroundColor Green
# Verify
Write-Host "`n-- Verify sleep states --" -ForegroundColor Cyan
powercfg /a
Write-Host "`n===== BLOCK COMPLETE =====" -ForegroundColor Green
Write-Host "`n===== BLOCK H: Copilot, AI, Cortana, Game DVR, CDP =====" -ForegroundColor Cyan
function Set-Reg($path, $name, $value, $type = "DWord") {
if (-not (Test-Path $path)) { New-Item -Path $path -Force | Out-Null }
New-ItemProperty -Path $path -Name $name -Value $value -PropertyType $type -Force | Out-Null
Write-Host " $path :: $name = $value" -ForegroundColor Gray
}
# ================================================================
# COPILOT / AI
# ================================================================
Write-Host "`n-- Copilot / Windows AI --" -ForegroundColor Yellow
# Policy: disable Copilot for all users
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot" "TurnOffWindowsCopilot" 1
Set-Reg "HKCU:\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot" "TurnOffWindowsCopilot" 1
# Hide Copilot button from taskbar
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "ShowCopilotButton" 0
# Disable Recall (Windows 11 24H2 AI feature that screenshots everything)
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" "DisableAIDataAnalysis" 1
Set-Reg "HKCU:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" "DisableAIDataAnalysis" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" "AllowRecallEnablement" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" "DisableClickToDo" 1
Set-Reg "HKCU:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" "DisableClickToDo" 1
# Disable Click to Do / AI image features on File Explorer context menus
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" "DisableImageCreator" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" "DisableCocreator" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" "DisableGenerativeFill" 1
# Disable "Windows Copilot Runtime" / Smart Opt-in
Set-Reg "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" "DisableSearchBoxSuggestions" 1
# Remove the aimgr AppX package (Windows AI Manager) - it was in your Phase 1 report
Get-AppxPackage -Name "aimgr" -AllUsers -ErrorAction SilentlyContinue | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -eq "aimgr" } | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue | Out-Null
# ================================================================
# CORTANA
# ================================================================
Write-Host "`n-- Cortana --" -ForegroundColor Yellow
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" "AllowCortana" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" "DisableWebSearch" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" "ConnectedSearchUseWeb" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" "AllowCloudSearch" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" "AllowSearchToUseLocation" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" "AllowCortanaAboveLock" 0
# Try to remove the Cortana AppX (it may or may not be installed on 24H2; it's deprecated)
Get-AppxPackage -Name "Microsoft.549981C3F5F10" -AllUsers -ErrorAction SilentlyContinue | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
# ================================================================
# GAME DVR / GAME MODE / XBOX BACKGROUND
# ================================================================
Write-Host "`n-- Game DVR, Game Mode, Xbox background --" -ForegroundColor Yellow
# Disable Game DVR (the silent background recorder)
Set-Reg "HKCU:\System\GameConfigStore" "GameDVR_Enabled" 0
Set-Reg "HKCU:\System\GameConfigStore" "GameDVR_FSEBehaviorMode" 2
Set-Reg "HKCU:\System\GameConfigStore" "GameDVR_HonorUserFSEBehaviorMode" 1
Set-Reg "HKCU:\System\GameConfigStore" "GameDVR_DXGIHonorFSEWindowsCompatible" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" "AllowGameDVR" 0
# Disable Game Mode
Set-Reg "HKCU:\Software\Microsoft\GameBar" "AllowAutoGameMode" 0
Set-Reg "HKCU:\Software\Microsoft\GameBar" "AutoGameModeEnabled" 0
Set-Reg "HKCU:\Software\Microsoft\GameBar" "UseNexusForGameBarEnabled" 0
Set-Reg "HKCU:\Software\Microsoft\GameBar" "ShowStartupPanel" 0
# Disable Xbox-related services
$xboxServices = @(
"XblAuthManager", # Xbox Live Auth Manager
"XblGameSave", # Xbox Live Game Save
"XboxNetApiSvc", # Xbox Live Networking Service
"XboxGipSvc", # Xbox Accessory Management
"BcastDVRUserService" # Broadcast DVR user service (per-user, name has random suffix)
)
foreach ($svc in $xboxServices) {
# Handle per-user services (suffixed with random hex) via wildcard match
Get-Service -Name "$svc*" -ErrorAction SilentlyContinue | ForEach-Object {
try {
Stop-Service -Name $_.Name -Force -ErrorAction SilentlyContinue
Set-Service -Name $_.Name -StartupType Disabled -ErrorAction Stop
Write-Host "Disabled service: $($_.Name)" -ForegroundColor Green
} catch {
Write-Host "Could not disable (may be protected): $($_.Name)" -ForegroundColor DarkYellow
}
}
}
# ================================================================
# CONNECTED DEVICES PLATFORM (CDP)
# ================================================================
Write-Host "`n-- Connected Devices Platform --" -ForegroundColor Yellow
# Policy: disable cross-device experiences
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" "EnableCdp" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" "EnableMmx" 0 # Phone Link / mobile experiences
# Disable CDP services (CDPSvc + per-user CDPUserSvc_xxxxx)
$cdpServices = @("CDPSvc", "CDPUserSvc")
foreach ($svc in $cdpServices) {
Get-Service -Name "$svc*" -ErrorAction SilentlyContinue | ForEach-Object {
try {
Stop-Service -Name $_.Name -Force -ErrorAction SilentlyContinue
Set-Service -Name $_.Name -StartupType Disabled -ErrorAction Stop
Write-Host "Disabled service: $($_.Name)" -ForegroundColor Green
} catch {
Write-Host "Could not disable: $($_.Name) — $_" -ForegroundColor DarkYellow
}
}
}
# Also disable the "Nearby Sharing" / device discovery
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\CDP" "CdpSessionUserAuthzPolicy" 0
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\CDP" "RomeSdkChannelUserAuthzPolicy" 0
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\CDP" "NearShareChannelUserAuthzPolicy" 0
Write-Host "`n===== BLOCK COMPLETE =====" -ForegroundColor Green
Write-Host "NOTE: Some Copilot/AI settings require sign-out or reboot to fully apply." -ForegroundColor Cyan
Write-Host "`n===== BLOCK I: Privacy & battery hardening =====" -ForegroundColor Cyan
function Set-Reg($path, $name, $value, $type = "DWord") {
if (-not (Test-Path $path)) { New-Item -Path $path -Force | Out-Null }
New-ItemProperty -Path $path -Name $name -Value $value -PropertyType $type -Force | Out-Null
Write-Host " $path :: $name = $value" -ForegroundColor Gray
}
# ================================================================
# STORAGE SENSE
# ================================================================
Write-Host "`n-- Storage Sense (auto file deletion) --" -ForegroundColor Yellow
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" "01" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\StorageSense" "AllowStorageSenseGlobal" 0
# ================================================================
# ONLINE SPEECH RECOGNITION
# ================================================================
Write-Host "`n-- Online Speech Recognition --" -ForegroundColor Yellow
Set-Reg "HKCU:\Software\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy" "HasAccepted" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\InputPersonalization" "AllowInputPersonalization" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Speech" "AllowSpeechModelUpdate" 0
# ================================================================
# INKING & TYPING PERSONALIZATION
# ================================================================
Write-Host "`n-- Inking & Typing Personalization --" -ForegroundColor Yellow
Set-Reg "HKCU:\Software\Microsoft\InputPersonalization" "RestrictImplicitInkCollection" 1
Set-Reg "HKCU:\Software\Microsoft\InputPersonalization" "RestrictImplicitTextCollection" 1
Set-Reg "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" "HarvestContacts" 0
Set-Reg "HKCU:\Software\Microsoft\Personalization\Settings" "AcceptedPrivacyPolicy" 0
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\TextInput" "AllowLinguisticDataCollection" 0
# ================================================================
# FIND MY DEVICE
# ================================================================
Write-Host "`n-- Find My Device --" -ForegroundColor Yellow
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\FindMyDevice" "AllowFindMyDevice" 0
Set-Reg "HKLM:\SOFTWARE\Microsoft\Settings\FindMyDevice" "LocationSyncEnabled" 0
# ================================================================
# APP LAUNCH TRACKING ("relevant results in Start")
# ================================================================
Write-Host "`n-- App launch tracking --" -ForegroundColor Yellow
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Start_TrackProgs" 0
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Start_TrackDocs" 0
# ================================================================
# WINDOWS TIPS / SUGGESTIONS / NOTIFICATIONS
# ================================================================
Write-Host "`n-- Tips, Suggestions, Notifications --" -ForegroundColor Yellow
# Keep normal app notifications working (Slack/Teams/email etc.)
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" "ToastEnabled" 1
# Kill "tips, tricks, suggestions"
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-338389Enabled" 0
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-338393Enabled" 0
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-353694Enabled" 0
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-353696Enabled" 0
# "Suggest ways I can finish setting up my device" (the post-login OOBE nag)
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement" "ScoobeSystemSettingEnabled" 0
# "Show me the Windows welcome experience after updates and occasionally when I sign in"
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-310093Enabled" 0
# Notifications from "Windows" itself (tips in Action Center)
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.Suggested" "Enabled" 0
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel" "Enabled" 0
# Policy-level kills (belt & suspenders)
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableWindowsSpotlightFeatures" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableWindowsSpotlightOnActionCenter" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableWindowsSpotlightOnSettings" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableWindowsSpotlightWindowsWelcomeExperience" 1
Set-Reg "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableThirdPartySuggestions" 1
# Lock screen spotlight off (use plain picture instead)
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "RotatingLockScreenEnabled" 0
Set-Reg "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "RotatingLockScreenOverlayEnabled" 0
# ================================================================
# AUTOMATIC MAINTENANCE WAKE (bonus — you asked for battery life)
# ================================================================
Write-Host "`n-- Automatic Maintenance wake timer --" -ForegroundColor Yellow
Set-Reg "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance" "WakeUp" 0
Write-Host "`n===== BLOCK COMPLETE =====" -ForegroundColor Green
# REBOOT
# ================================================================
# CREATE THE FINAL RESTORE POINT
# ================================================================
# Windows rate-limits restore points to one per 24 hours by default.
# Lower that to 0 so this one definitely takes.
$srPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore"
if (-not (Test-Path $srPath)) { New-Item -Path $srPath -Force | Out-Null }
New-ItemProperty -Path $srPath -Name "SystemRestorePointCreationFrequency" -Value 0 -PropertyType DWord -Force | Out-Null
Enable-ComputerRestore -Drive "C:\"
Checkpoint-Computer -Description "Post-Debloat Clean Baseline" -RestorePointType "MODIFY_SETTINGS"
Write-Host "Restore point created." -ForegroundColor Green
# List all restore points so you can confirm
Write-Host "`n-- All restore points --" -ForegroundColor Yellow
Get-ComputerRestorePoint | Select-Object SequenceNumber, CreationTime, Description, RestorePointType | Format-Table -AutoSize