# Automating Windows Setup with Claude Code AI

Using AI to generate PowerShell scripts for faster, customized Windows system installations.

- **Source:** [XDA Developers](https://www.xda-developers.com)
- **Published:** 2026-11-05
- **Topic:** [technology](https://brifing.si/c/technology)
- **Original article:** <https://www.xda-developers.com/claude-code-fresh-windows-install-script/>
- **On Brifing:** https://brifing.si/s/b6308384-7cab-4419-87fa-5b046e5bd4ae

## Automating Windows Rituals

System administrator Korbin Brown utilized Claude Code to automate the repetitive process of setting up fresh Windows installations. By shifting from manual configuration to a generated PowerShell script, he reduced his setup time to twenty minutes. This transition eliminates the need to manually toggle settings or install individual applications every time.

## Prompting the AI Assistant

The author provided Claude Code with a specific list of requirements, including preferred applications, Explorer tweaks, and features to disable. The AI returned a modular PowerShell script, organized into distinct sections for easy modification. This approach allowed the user to comment out specific parts of the code without breaking the entire process.

## Research and Script Generation

The primary challenge in creating such scripts is researching correct package IDs and registry values. Claude Code handled this by identifying the necessary winget identifiers and registry keys automatically. This saved the user from hours of manual documentation searches, effectively bridging the gap between intent and functional, executable code for Windows.

## Handling Complex System Tasks

The script manages complex tasks like installing Windows Subsystem for Linux, which requires a system reboot. To handle this, the script utilizes a RunOnce entry to resume operations automatically after the restart. This ensures a seamless transition between initial application installation and the final configuration of the terminal and system environment.

## Application Deployment Strategy

The script uses a loop to install essential software like Brave, Notepad++, and VS Code via winget. By employing the -e flag, the script ensures strict matching of package IDs to avoid installing incorrect versions. This automated method guarantees that the user receives official, verified applications without needing to interact with individual prompts.

## Registry and Debloat Logic

Registry edits are applied to customize the interface, such as enabling dark mode and showing hidden file extensions. The script also performs a debloat operation, removing unwanted features like Copilot, Recall, and Start menu recommendations. Using variables for repetitive registry paths keeps the code clean and easier to audit for potential errors.

## Safety and Verification Measures

Executing scripts from any source carries risks, so the author emphasizes caution when running AI-generated code. He recommends using Windows Sandbox to test the script before applying it to a primary machine. Additionally, he requested that Claude cite its sources, allowing him to verify the commands against official documentation for accuracy.

## AI as a Productivity Partner

This project demonstrates how AI can overcome procrastination by handling the tedious research phase of automation. While the script requires occasional updates to remain compatible with new Windows versions, it serves as a powerful tool for streamlining system management. It transforms a long-standing to-do list item into a functional, repeatable workflow.

## Sources covering this story

- https://www.xda-developers.com/claude-code-fresh-windows-install-script/ — 

---

_Summary written by Brifing from the original reporting. Copyright in the original article belongs to its publisher; read the full piece at the link above._
