Consumer Windows is tuned for a casual user: it sleeps mid-task, phones home with telemetry, and ships gaming services a developer never touches. If you run long automation, scraping pipelines, or Playwright jobs, a few settings changes make the machine stable and quiet. Here’s a single PowerShell script that applies them, and the safety steps to run it sanely.
The point isn’t to strip Windows bare; it’s to stop the machine from interrupting long-running work and to surface the things developers actually need. It pairs with running a laptop as an always-on server: same instinct, applied to the whole workstation.
Sleeps + powers down disk mid-task. Telemetry + ad-ID on. Xbox services running. Long paths off; extensions + hidden files hidden.
No sleep/disk-off/hibernate — long jobs run through. Telemetry off, Xbox off. Long paths ON for Python; extensions + hidden files shown.
Table of Contents
What the script changes
Five groups of settings, each aimed at a specific developer pain:
- Power: via
powercfg, activates a high-performance plan and disables sleep, disk timeout, hibernation, and USB selective suspend, so a long scrape or build never gets suspended mid-run. - Privacy/telemetry: turns off the advertising ID, activity history, tailored experiences, location tracking, and feedback prompts, cutting background chatter and interruptions.
- Developer ergonomics: enables long path support (Python and Node dependency trees routinely blow past the old 260-char limit), and shows file extensions and hidden files (so
.env,.git,.vscodeare visible). - Network stability: stops the network adapter from powering down, which otherwise drops long-lived connections during scraping or API polling.
- Cleanup: disables the Xbox services a dev box never uses, trimming startup and background load.
The script
Save this as dev-workstation-setup.ps1:
Write-Host "Applying development workstation configuration..."
# --- POWER ---
powercfg -setactive SCHEME_MIN
powercfg /change standby-timeout-ac 0
powercfg /change standby-timeout-dc 0
powercfg /change monitor-timeout-ac 20
powercfg -change -disk-timeout-ac 0
powercfg -h off
powercfg -setacvalueindex scheme_current sub_usb usbselectivesuspend 0
powercfg -setactive scheme_current
# --- PRIVACY / TELEMETRY ---
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v Enabled /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v PublishUserActivities /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Privacy" /v TailoredExperiencesWithDiagnosticDataEnabled /t REG_DWORD /d 0 /f
# --- DEVELOPER SETTINGS ---
reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t REG_DWORD /d 1 /f
# --- NETWORK STABILITY ---
powercfg -setacvalueindex scheme_current sub_none netpowerdown 0
powercfg -setactive scheme_current
# --- CLEANUP: disable Xbox services ---
foreach ($svc in "XblAuthManager","XblGameSave","XboxNetApiSvc") {
Stop-Service $svc -ErrorAction SilentlyContinue
Set-Service $svc -StartupType Disabled
}
Write-Host "Done. Restart for best results."
Code language: PowerShell (powershell)
How to run it safely
The safety steps aren’t optional, because this changes system settings:
- Create a restore point first: System Protection → Create Restore Point. This is your one-click undo.
- Open PowerShell as Administrator (Start → PowerShell → Run as Administrator).
- Allow the script for this session only:
Set-ExecutionPolicy RemoteSigned -Scope Process. Without-Scope Processthe change persists after you close the window. - Run it:
.\dev-workstation-setup.ps1, then restart.
Create the restore point before you run anything — it’s the one-click undo for every change here.
Where NOT to run it
This is for a personal development machine. Don’t run it on:
- Corporate / managed machines: it may violate IT policy and fight group policy.
- Shared computers: it changes privacy and service settings for everyone.
- Gaming PCs: it disables Xbox services.
- Battery-dependent laptops: disabling sleep will drain the battery; keep this for mains-powered or always-on machines (the laptop-as-a-server case).
Great on your own plugged-in dev box; wrong on a corporate laptop or a machine you share — know which you have.
The short version
This PowerShell script turns consumer Windows into a stable dev/automation workstation: it disables sleep, disk-off and hibernation so long jobs run uninterrupted; turns off advertising ID, activity history and tailored experiences; enables long paths for Python and shows file extensions and hidden files; stops the network adapter powering down; and disables Xbox services. Create a restore point, run it as Administrator with Set-ExecutionPolicy RemoteSigned -Scope Process, then restart. Use it only on a personal, plugged-in machine, never a corporate, shared, or battery-dependent one.
Frequently Asked Questions
Does it work on Windows 11?
Mostly. The power, privacy and developer settings apply the same way; a few registry paths differ slightly between versions, so review the output and confirm the developer settings (long paths, show extensions) took effect.
What if Create Restore Point is greyed out?
System Protection is switched off for the system drive, which is common on new installs. In the System Protection tab, select the C: drive, click Configure, turn protection on and give it some disk space. Then create the restore point before you run the script.
Does enabling long paths fix git as well?
Not on its own. Git for Windows has its own setting, so also run git config --global core.longpaths true. Without it, cloning or checking out a repo with deeply nested folders can still fail with “Filename too long”.
Can these changes be reversed?
Yes. Roll back with the restore point you created, or reverse individually: re-enable sleep in power settings, flip the registry values back, and set the Xbox services to start again with Set-Service <name> -StartupType Manual, their default. Nothing here is destructive or permanent.