|

I Let Claude Take FULL Control of a Fresh Windows 11 PC (Debloat + Setup)

Claude Code AI debloating and setting up a fresh Windows 11 PC via PowerShell

I gave Claude Code a single PowerShell prompt and let it debloat and configure a fresh Windows 11 25H2 virtual machine from start to finish. It created a restore point, removed bloatware apps, installed my software through WinGet, applied my taskbar, Start menu, and privacy preferences, and saved a reusable setup script I can run on any new install.

Applies to: Windows 11 (24H2, 25H2) | Last updated: May 28, 2026

I Let Claude Take FULL Control of a Fresh Windows 11 PC (Debloat + Setup)

Key Takeaways

  • Claude Code can run PowerShell, not just write code — that means an AI command-line tool can debloat and configure Windows directly, without you clicking through Settings.
  • One detailed prompt did the whole job — bloatware removal, WinGet app installs, dark mode, taskbar and Start menu layout, and privacy/telemetry changes on Windows 11 25H2.
  • It created a System Restore point first and asked before deleting anything — Claude paused to confirm how aggressive the bloatware removal should be before touching the system.
  • The best output is a reusable script — a complete PowerShell setup script (included in this guide) that reproduces the entire configuration on any fresh install in about five minutes.
  • This is an experiment, not a recommendation — run it only in a virtual machine, because bypass-permissions mode lets the AI execute system commands without asking.

Quick Steps:

  1. Set up a Windows 11 virtual machine — never test this on your main PC.
  2. Install Claude Code in the VM and enable bypass-permissions mode.
  3. Paste the setup prompt (below), describing exactly how you want the machine configured.
  4. Answer Claude’s clarifying question about how aggressively to remove bloatware.
  5. Let it research the registry settings, install your apps via WinGet, and apply the tweaks.
  6. Have it save the steps as a reusable PowerShell script on the Desktop.
  7. Run that script on any fresh install to get the same result in minutes.

The Exact Prompt I Gave Claude Code

Everything started with one prompt. I told Claude Code it was on a fresh Windows 11 25H2 install on an admin account, then listed exactly what I wanted done. Here is the full prompt, ready to copy and adapt for your own setup:

You are on a fresh Windows 11 25H2 installation on an Admin account and I want you to do the following using PowerShell/CMD.

1. Set up this new machine for me by:
1.1 Removing Bloatware Windows Apps (I only use Calculator, Notepad and Terminal - The rest can be removed)
1.2 Installing software I will use via winget (Brave Browser, Nilesoft Shell, Notepad++)
1.3 Enabling Dark Mode
1.4 Left Aligning the Taskbar and having only File Explorer pinned, no Search or Task View buttons.
1.5 Setting File Explorer default location to This PC and showing file extensions.
1.6 Disabling or turning off all Privacy settings in Privacy & Security to disable all telemetry in Windows.
1.7 Turning off all background apps or processes that don't need to be running all the time.
1.8 Unpin all tiles from the Start Menu and set the All Apps View Mode to List.
1.9 Anything else I might be missing to have this machine running optimally.

Before you start:
Create a restore point
In case there is commands you can't run inline and you need to save scripts, you can save them on the Desktop and run it from there.
You have internet access if you need to research any registry entries etc. from Microsoft docs to complete this task.

Tell me when you're done.

The key to a result like this is being specific. Each numbered item is a concrete instruction, and the “anything else I might be missing” line gives Claude room to apply sensible extras — it ended up disabling telemetry scheduled tasks I never explicitly asked for. The “create a restore point” line is the most important one, because it gives you a clean rollback if anything goes wrong.

What Is Claude Code, and Why Use It to Set Up Windows?

Claude Code is a command-line tool from Anthropic that runs AI models in your terminal. It is normally used to write code and build projects, but it can also execute PowerShell commands and scripts directly on your machine. That second ability is what makes it interesting for Windows setup.

Instead of clicking through dozens of Settings pages after every clean install, you describe the end state once and let the tool do the work. In my test it did not just run blind commands — it researched the correct registry entries from Microsoft’s documentation before changing anything it was unsure about, which is exactly what I hoped to see.

Important: Only Do This in a Virtual Machine

The safety part matters, so I want to be clear about it. I ran this entire test inside a virtual machine that is completely separate from my main computer, and I turned on bypass permissions so Claude could run commands without stopping to ask each time. That combination is powerful but risky — you are handing an AI the ability to make system-level changes automatically.

Treat this as an experiment, not a daily-driver workflow. Do not run it on a PC with data or settings you care about. A virtual machine gives you a contained, throwaway environment where you can let the AI work, watch what it does, and test the resulting script safely.

Tip: Always include “create a restore point” as the first instruction. Even in a VM, a restore point lets you undo the changes instantly if a tweak breaks something.

How Claude Set Up the PC, Step by Step

Claude worked through the task methodically rather than firing off commands at random. The first thing it did was configure System Restore and create a restore point named “before Claude setup,” which I confirmed in the Windows UI before it continued.

Next, it paused and asked a clarifying question: how aggressive should the bloatware removal be? It offered a balanced option (keep genuinely useful apps like Photos, Snipping Tool, and Paint), a strict/minimal option (remove everything except Calculator, Notepad, and Terminal plus required system frameworks), and a balanced option that also removed the Microsoft Store. I chose the strict option for this test, and it correctly refused to remove critical system frameworks or shell components that would break Windows itself.

From there it researched the registry mappings it was unsure about — the Start menu list view, unpinning all tiles, and the taskbar layout — by reading Microsoft’s documentation. Then it ran through the rest of the work:

  • Installed my apps via WinGet first, while the system was still intact
  • Removed the bloatware apps based on my strict selection
  • Enabled dark mode and applied a dark wallpaper
  • Left-aligned the taskbar, pinned only File Explorer, and removed the Search and Task View buttons
  • Set File Explorer to open to This PC and enabled file extensions
  • Disabled the privacy and telemetry settings in Privacy & Security — and went a step further by disabling the telemetry scheduled tasks too
  • Turned off unnecessary background apps
  • Unpinned all Start menu tiles and set the All Apps view to list mode

If you would rather handle bloatware removal manually, I have a separate guide on the official Windows 11 25H2 bloatware removal method that does not involve any AI at all.

The Software Claude Installed via WinGet

WinGet is the package manager built into Windows, so Claude could install everything from the command line without downloading a single installer by hand. The apps I asked for in the prompt were:

After the first pass I had Claude add two more to the script so a fresh install would include them automatically: FastStone Image Viewer for viewing images and Media Player Classic – Black Edition for media playback. Because they were added to the script, they install on any machine I run it on.

The Reusable Setup Script (Copy, Paste, Run)

The single best outcome was not the configured VM — it was the script. Claude bundled every step into one PowerShell file, just over 300 lines long, that handles the WinGet installs, the app removals, the registry tweaks, the Start and taskbar layout, the telemetry and background-app changes, the wallpaper, and an Explorer restart. It also creates a restore point before it does anything and writes a log to your Desktop.

I do not host the file anywhere, so the full script is included below. To use it, copy everything in the box, paste it into Notepad, and save it as Setup-Windows.ps1 — in the Save dialog, change “Save as type” to “All Files” so it does not save as a .txt file.

Read this before you run it: This is my personal, deliberately strict setup. It removes apps many people want to keep — including the Microsoft Store, Photos, Paint, Snipping Tool, and Camera — and it installs my chosen apps (Brave, Nilesoft Shell, Notepad++, FastStone, MPC-BE). Open the script and edit the $apps and $removeApps lists to match your own preferences first. Always test it in a virtual machine before running it on a real PC, and remember it creates a restore point so you can roll back.

<#
    Setup-Windows.ps1
    Fresh Windows 11 25H2 (build 26200) setup / debloat / privacy hardening.
    Run elevated (Admin). The script creates a system restore point before making changes.

    Sections:
      *. Create a system restore point (pre-flight)
      0. Install applications via winget (Brave, Nilesoft Shell, Notepad++, FastStone, MPC-BE)
      1. Remove bloatware Appx apps (keep Calculator, Notepad, Terminal + system frameworks)
      2. Dark mode + dark wallpaper
      3. Taskbar: left align, hide Search / Task View / Widgets, pin only File Explorer
      4. File Explorer: open to This PC, show file extensions
      5. Privacy & telemetry hardening
      6. Disable background apps
      7. Telemetry services + scheduled tasks
      8. Start menu: unpin all, All Apps = List view
      9. Extra "run optimally" tweaks
     10. Restart Explorer
#>

$ErrorActionPreference = 'Continue'
$log = "$env:USERPROFILE\Desktop\Setup-Windows.log"
Start-Transcript -Path $log -Force | Out-Null
Write-Host "==== Windows setup started $(Get-Date) ====" -ForegroundColor Cyan

# --- helper: set a registry value, creating the key path if needed ---
function Set-Reg {
    param([string]$Path,[string]$Name,$Value,[string]$Type = 'DWord')
    try {
        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
    } catch {
        Write-Host "  ! Set-Reg failed: $Path\$Name -> $($_.Exception.Message)" -ForegroundColor Yellow
    }
}

#region Pre-flight: System Restore point
Write-Host "`n[*] Creating a system restore point..." -ForegroundColor Cyan
try {
    # Remove the 24h throttle so a checkpoint is always created
    New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore' -Name 'SystemRestorePointCreationFrequency' -Value 0 -PropertyType DWord -Force | Out-Null
    Enable-ComputerRestore -Drive 'C:\' -ErrorAction SilentlyContinue
    Set-Service -Name VSS -StartupType Manual -ErrorAction SilentlyContinue
    Start-Service -Name VSS -ErrorAction SilentlyContinue
    Checkpoint-Computer -Description 'Before Windows setup script' -RestorePointType 'MODIFY_SETTINGS' -ErrorAction Stop
    Write-Host "  - Restore point 'Before Windows setup script' created." -ForegroundColor Green
} catch {
    Write-Host "  ! Could not create restore point: $($_.Exception.Message)" -ForegroundColor Yellow
    Write-Host "    Continuing anyway - you can create one manually (System Protection)." -ForegroundColor Yellow
}
#endregion

#region 0. Install applications (winget)
Write-Host "`n[0] Installing applications via winget..." -ForegroundColor Cyan
$apps = @(
    'Brave.Brave',
    'Nilesoft.Shell',
    'Notepad++.Notepad++',
    'FastStone.Viewer',
    'MPC-BE.MPC-BE'
)
foreach ($id in $apps) {
    Write-Host "  Installing $id ..." -ForegroundColor Gray
    winget install --id $id --exact --silent --accept-package-agreements --accept-source-agreements --disable-interactivity
    if ($LASTEXITCODE -eq 0) { Write-Host "  - Installed: $id" -ForegroundColor Green }
    else { Write-Host "  ! winget exit $LASTEXITCODE for $id (may already be installed)" -ForegroundColor Yellow }
}
#endregion

#region 1. Remove bloatware Appx apps
Write-Host "`n[1] Removing bloatware apps..." -ForegroundColor Cyan
$removeApps = @(
    'Clipchamp.Clipchamp','Microsoft.BingNews','Microsoft.BingSearch','Microsoft.BingWeather',
    'Microsoft.GamingApp','Microsoft.GetHelp','Microsoft.MicrosoftOfficeHub',
    'Microsoft.MicrosoftSolitaireCollection','Microsoft.MicrosoftStickyNotes','Microsoft.Paint',
    'Microsoft.PowerAutomateDesktop','Microsoft.ScreenSketch','Microsoft.StorePurchaseApp',
    'Microsoft.Todos','Microsoft.Windows.DevHome','Microsoft.Windows.Photos','Microsoft.WindowsAlarms',
    'Microsoft.WindowsCamera','Microsoft.WindowsFeedbackHub','Microsoft.WindowsSoundRecorder',
    'Microsoft.WindowsStore','Microsoft.Xbox.TCUI','Microsoft.XboxGameOverlay','Microsoft.XboxGamingOverlay',
    'Microsoft.XboxIdentityProvider','Microsoft.XboxSpeechToTextOverlay','Microsoft.YourPhone',
    'Microsoft.ZuneMusic','Microsoft.ZuneVideo','MicrosoftCorporationII.QuickAssist',
    'MicrosoftWindows.CrossDevice','Microsoft.549981C3F5F10','Microsoft.People','Microsoft.WindowsMaps',
    'microsoft.windowscommunicationsapps','Microsoft.OutlookForWindows','Microsoft.MicrosoftJournal',
    'MSTeams','MicrosoftTeams','Microsoft.Copilot'
)
# Apps we explicitly KEEP (never touch): Calculator, Notepad, Terminal, Edge, and all frameworks/runtimes.
foreach ($app in $removeApps) {
    $pkg = Get-AppxPackage -AllUsers -Name $app -ErrorAction SilentlyContinue
    if ($pkg) {
        try {
            $pkg | Remove-AppxPackage -AllUsers -ErrorAction Stop
            Write-Host "  - Removed (installed): $app" -ForegroundColor Green
        } catch {
            Write-Host "  ! Could not remove $app : $($_.Exception.Message)" -ForegroundColor Yellow
        }
    }
    $prov = Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -eq $app }
    if ($prov) {
        try {
            $prov | Remove-AppxProvisionedPackage -Online -ErrorAction Stop | Out-Null
            Write-Host "  - Removed (provisioned): $app" -ForegroundColor DarkGreen
        } catch {
            Write-Host "  ! Could not deprovision $app : $($_.Exception.Message)" -ForegroundColor Yellow
        }
    }
}
#endregion

#region 2. Dark mode
Write-Host "`n[2] Enabling dark mode + dark wallpaper..." -ForegroundColor Cyan
$theme = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize'
Set-Reg $theme 'AppsUseLightTheme' 0
Set-Reg $theme 'SystemUsesLightTheme' 0
# Apply the default Windows 11 dark wallpaper (img19.jpg = dark variant of the default 'bloom')
$darkWall = 'C:\Windows\Web\Wallpaper\Windows\img19.jpg'
if (Test-Path $darkWall) {
    Set-ItemProperty 'HKCU:\Control Panel\Desktop' -Name WallPaper      -Value $darkWall
    Set-ItemProperty 'HKCU:\Control Panel\Desktop' -Name WallpaperStyle -Value 10   # 10 = Fill
    Set-ItemProperty 'HKCU:\Control Panel\Desktop' -Name TileWallpaper  -Value 0
    if (-not ('WpApply' -as [type])) {
        Add-Type @"
using System.Runtime.InteropServices;
public class WpApply { [DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)] public static extern bool SystemParametersInfo(int a,int b,string c,int d); }
"@
    }
    [WpApply]::SystemParametersInfo(20,0,$darkWall,3) | Out-Null   # SPI_SETDESKWALLPAPER, update + broadcast
    Write-Host "  - Dark wallpaper applied" -ForegroundColor Green
} else {
    Write-Host "  ! Dark wallpaper not found at $darkWall" -ForegroundColor Yellow
}
#endregion

#region 3. Taskbar
Write-Host "`n[3] Configuring taskbar..." -ForegroundColor Cyan
$adv = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced'
Set-Reg $adv 'TaskbarAl' 0            # 0 = left align
Set-Reg $adv 'ShowTaskViewButton' 0   # hide Task View button
Set-Reg $adv 'TaskbarMn' 0            # hide Chat/Copilot button  (Widgets is disabled via the AllowNewsAndInterests policy in section 9 - the Advanced\TaskbarDa value is system-protected on 25H2 and rejects writes)
Set-Reg 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Search' 'SearchboxTaskbarMode' 0  # hide search box/icon

# Pin ONLY File Explorer to the taskbar (replace default Edge/Store pins) via Start Layout policy XML.
$cfgDir = 'C:\ProgramData\ClaudeSetup'
if (-not (Test-Path $cfgDir)) { New-Item -ItemType Directory -Path $cfgDir -Force | Out-Null }
$taskbarXml = @'
<?xml version="1.0" encoding="utf-8"?>
<LayoutModificationTemplate
    xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification"
    xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout"
    xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout"
    xmlns:taskbar="http://schemas.microsoft.com/Start/2014/TaskbarLayout"
    Version="1">
  <CustomTaskbarLayoutCollection PinListPlacement="Replace">
    <defaultlayout:TaskbarLayout>
      <taskbar:TaskbarPinList>
        <taskbar:DesktopApp DesktopApplicationID="Microsoft.Windows.Explorer" />
      </taskbar:TaskbarPinList>
    </defaultlayout:TaskbarLayout>
  </CustomTaskbarLayoutCollection>
</LayoutModificationTemplate>
'@
$taskbarFile = Join-Path $cfgDir 'TaskbarLayout.xml'
Set-Content -Path $taskbarFile -Value $taskbarXml -Encoding UTF8
$expPol = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer'
Set-Reg $expPol 'LockedStartLayout' 1
Set-Reg $expPol 'StartLayoutFile' $taskbarFile 'ExpandString'
#endregion

#region 4. File Explorer
Write-Host "`n[4] Configuring File Explorer..." -ForegroundColor Cyan
Set-Reg $adv 'LaunchTo' 1     # 1 = This PC
Set-Reg $adv 'HideFileExt' 0  # show file extensions
#endregion

#region 5. Privacy & telemetry
Write-Host "`n[5] Hardening privacy / disabling telemetry..." -ForegroundColor Cyan
# Diagnostic data / telemetry (Pro honours AllowTelemetry=0 = Security/Off)
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection' 'AllowTelemetry' 0
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection' 'DoNotShowFeedbackNotifications' 1
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection' 'AllowDeviceNameInTelemetry' 0
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection' 'LimitDiagnosticLogCollection' 1
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection' 'LimitDumpCollection' 1
Set-Reg 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection' 'AllowTelemetry' 0
# Advertising ID
Set-Reg 'HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo' 'Enabled' 0
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo' 'DisabledByGroupPolicy' 1
# Tailored experiences with diagnostic data
Set-Reg 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Privacy' 'TailoredExperiencesWithDiagnosticDataEnabled' 0
# Let websites access language list
Set-Reg 'HKCU:\Control Panel\International\User Profile' 'HttpAcceptLanguageOptOut' 1
# Let Windows track app launches
Set-Reg $adv 'Start_TrackProgs' 0
# Feedback frequency = never
Set-Reg 'HKCU:\Software\Microsoft\Siuf\Rules' 'NumberOfSIUFInPeriod' 0
# Speech online recognition
Set-Reg 'HKCU:\Software\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy' 'HasAccepted' 0
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\InputPersonalization' 'AllowInputPersonalization' 0
# Inking & typing personalization
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
# 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
# Location
Set-Reg 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location' 'Value' 'Deny' 'String'
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors' 'DisableLocation' 1
# Find My Device
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\FindMyDevice' 'AllowFindMyDevice' 0
# Suggested content / consumer features / Spotlight ads
$cdm = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager'
foreach ($v in 'SubscribedContent-338388Enabled','SubscribedContent-338389Enabled','SubscribedContent-338393Enabled',
    'SubscribedContent-353694Enabled','SubscribedContent-353696Enabled','SubscribedContent-310093Enabled',
    'SubscribedContent-88000326Enabled','SubscribedContent-338387Enabled','SystemPaneSuggestionsEnabled',
    'SilentInstalledAppsEnabled','PreInstalledAppsEnabled','OemPreInstalledAppsEnabled','ContentDeliveryAllowed',
    'FeatureManagementEnabled','RotatingLockScreenOverlayEnabled','SubscribedContentEnabled','SoftLandingEnabled') {
    Set-Reg $cdm $v 0
}
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent' 'DisableWindowsConsumerFeatures' 1
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent' 'DisableCloudOptimizedContent' 1
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent' 'DisableSoftLanding' 1
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent' 'DisableConsumerAccountStateContent' 1
# Search: no Bing/web/cloud, no history
Set-Reg 'HKCU:\Software\Microsoft\Windows\CurrentVersion\SearchSettings' 'IsAADCloudSearchEnabled' 0
Set-Reg 'HKCU:\Software\Microsoft\Windows\CurrentVersion\SearchSettings' 'IsMSACloudSearchEnabled' 0
Set-Reg 'HKCU:\Software\Microsoft\Windows\CurrentVersion\SearchSettings' 'IsDeviceSearchHistoryEnabled' 0
Set-Reg 'HKCU:\Software\Policies\Microsoft\Windows\Explorer' 'DisableSearchBoxSuggestions' 1
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search' 'AllowCortana' 0
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search' 'ConnectedSearchUseWeb' 0
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search' 'DisableWebSearch' 1
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search' 'AllowSearchToUseLocation' 0
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search' 'AllowCloudSearch' 0
# Windows Error Reporting
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting' 'Disabled' 1
# Windows Recall / AI data analysis
Set-Reg 'HKCU:\Software\Policies\Microsoft\Windows\WindowsAI' 'DisableAIDataAnalysis' 1
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI' 'DisableAIDataAnalysis' 1
# Copilot
Set-Reg 'HKCU:\Software\Policies\Microsoft\Windows\WindowsCopilot' 'TurnOffWindowsCopilot' 1
#endregion

#region 6. Background apps
Write-Host "`n[6] Disabling background apps..." -ForegroundColor Cyan
Set-Reg 'HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications' 'GlobalUserDisabled' 1
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy' 'LetAppsRunInBackground' 2  # 2 = Force Deny
Set-Reg 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Search' 'BackgroundAppGlobalToggle' 0
#endregion

#region 7. Telemetry services + scheduled tasks
Write-Host "`n[7] Disabling telemetry services and tasks..." -ForegroundColor Cyan
foreach ($svc in 'DiagTrack','dmwappushservice') {
    $s = Get-Service -Name $svc -ErrorAction SilentlyContinue
    if ($s) {
        try { Stop-Service -Name $svc -Force -ErrorAction SilentlyContinue } catch {}
        try { Set-Service -Name $svc -StartupType Disabled -ErrorAction Stop; Write-Host "  - Disabled service: $svc" -ForegroundColor Green } catch {}
    }
}
$tasks = @(
    '\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser',
    '\Microsoft\Windows\Application Experience\ProgramDataUpdater',
    '\Microsoft\Windows\Application Experience\StartupAppTask',
    '\Microsoft\Windows\Customer Experience Improvement Program\Consolidator',
    '\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip',
    '\Microsoft\Windows\Autochk\Proxy',
    '\Microsoft\Windows\Feedback\Siuf\DmClient',
    '\Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload'
)
foreach ($t in $tasks) {
    $name = Split-Path $t -Leaf
    $path = (Split-Path $t -Parent) + '\'
    try {
        Disable-ScheduledTask -TaskName $name -TaskPath $path -ErrorAction Stop | Out-Null
        Write-Host "  - Disabled task: $t" -ForegroundColor Green
    } catch {}
}
#endregion

#region 8. Start menu (unpin all + All Apps = List)
Write-Host "`n[8] Configuring Start menu..." -ForegroundColor Cyan
# Unpin all pinned items via the 25H2 "Configure Start Pins" policy (empty list, applyOnce so user can re-pin)
$startJson = '{ "applyOnce": true, "pinnedList": [] }'
$startFile = Join-Path $cfgDir 'StartPins.json'
Set-Content -Path $startFile -Value $startJson -Encoding UTF8
Set-Reg $expPol 'ConfigureStartPins' 1
Set-Reg $expPol 'ConfigureStartPinsJSON' $startFile 'ExpandString'
# All Apps view = List  (0 = Category, 1 = Grid, 2 = List)
Set-Reg 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Start' 'AllAppsViewMode' 2
# Hide Start "Recommended" recommendations / tips
Set-Reg $adv 'Start_IrisRecommendations' 0
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer' 'HideRecommendedSection' 1
Set-Reg 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'Start_Layout' 1
#endregion

#region 9. Extra optimal tweaks
Write-Host "`n[9] Applying extra tweaks..." -ForegroundColor Cyan
# Disable News & Interests / Widgets feature at machine level
Set-Reg 'HKLM:\SOFTWARE\Policies\Microsoft\Dsh' 'AllowNewsAndInterests' 0
# Enable 'End Task' on taskbar right-click (handy for power users)
Set-Reg 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\TaskbarDeveloperSettings' 'TaskbarEndTask' 1
# Lock screen: disable Windows spotlight 'fun facts/tips'
Set-Reg 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'RotatingLockScreenEnabled' 0
#endregion

#region 10. Restart Explorer
Write-Host "`n[10] Restarting Explorer to apply changes..." -ForegroundColor Cyan
Stop-Process -Name explorer -Force -ErrorAction SilentlyContinue
Start-Sleep -Seconds 2
if (-not (Get-Process -Name explorer -ErrorAction SilentlyContinue)) { Start-Process explorer.exe }
#endregion

Write-Host "`n==== Windows setup finished $(Get-Date) ====" -ForegroundColor Cyan
Stop-Transcript | Out-Null

Once the file is saved, open an admin terminal (right-click Start > Terminal (Admin)) and run it with this command, replacing the path with wherever you saved the file:

powershell.exe -ExecutionPolicy Bypass -File "C:\Users\YourName\Desktop\Setup-Windows.ps1"

On a second, completely fresh install, that script took the machine from default to exactly how I like it in about five minutes. It created the restore point, installed the apps, removed the bloatware, and applied every customization in quick succession. The result is predictable: you know precisely what state the machine will be in when it finishes.

What Didn’t Work (and What I Fixed)

No automation is perfect, and being honest about the gaps is the whole point of a test like this. Three things needed correcting:

  • All Apps view: Claude set the registry value for list view, but Windows kept showing the grid until the value was corrected. I had it fix this at the root in the script so I never have to set it manually.
  • A taskbar registry value: one taskbar write did not stick because that value is system-protected on 25H2, so I had Claude remove the broken line and hide Widgets through a policy instead.
  • Microsoft Edge: Edge was not removed in this session — it is deeply integrated and resists command-line removal. If you want it gone, see my guide on how to uninstall Microsoft Edge.

A Simpler Way to Debloat Windows (No AI Required)

If handing system control to an AI sounds like more risk than you want, you do not need Claude Code to get a clean, debloated Windows install. I build two free tools that do this safely and predictably.

Winhance is my Windows enhancement utility — a point-and-click app that debloats, optimizes, and customizes Windows 10 and 11, with changes that are easy to reverse. It covers most of what I asked Claude to do here, but through a GUI and without running unsupervised commands. For the install side, UnattendedWinstall lets you automate the Windows installation itself with an answer file, so the machine arrives debloated from first boot.

Going Further: AI for PC Maintenance

Setting up a fresh install is only the beginning. The same approach — an AI command-line tool that can run commands and read its own output — could run diagnostics, dig through Event Viewer logs, or handle routine maintenance on a machine. Claude Code is one option for this; OpenCode is an open-source command-line tool that works in a similar way if you prefer an alternative.

Frequently Asked Questions

Is it safe to let Claude Code control Windows?

Only in a controlled environment. Run it inside a virtual machine, not on your main PC, and always have it create a restore point first. Bypass-permissions mode lets the AI execute system commands without asking each time, which is convenient but means you should never point it at a machine with data or settings you cannot afford to lose.

Do I need to know PowerShell to do this?

No. You describe what you want in plain English and Claude writes and runs the PowerShell for you. That said, you should still review the script it produces before running it on a real machine, so you understand what each section changes.

What does “bypass permissions” do in Claude Code?

It tells Claude Code to run commands automatically without prompting you to approve each one. It makes a start-to-finish setup possible without babysitting every step, but it also removes your chance to stop a command before it runs — which is exactly why it belongs in a virtual machine.

Can I reuse the setup on other PCs?

Yes — that is the main benefit. Claude saves the entire configuration as a single PowerShell script. Copy that script to any fresh Windows install, run it from an admin terminal, and it reproduces the same apps, removals, and tweaks in a few minutes without needing the AI again.

Is there a way to debloat Windows without using AI?

Absolutely. Winhance gives you a GUI to debloat, optimize, and customize Windows with reversible changes, and UnattendedWinstall automates the install itself with an answer file. If you prefer Microsoft’s built-in approach, the official Windows 11 25H2 bloatware removal method works without any third-party tools.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *