Thoughts on AI generated Windows 11 Optimisation Powershell script

Configure and optimize you computer for Audio.
Post Reply New Topic
RELATED
PRODUCTS

Post

I just had a discussion about optimising my Windows 11 PC for running Bitwig Studio. It generated the following Powershell script for me. However I lack the technical knowledge to assess if all this is safe or wise, or if are other things that could be added to it. Any thoughts very much welcomed.

Code: Select all

<#
    Bitwig / DAW Performance Optimization Script for Windows 11
    ------------------------------------------------------------
    Safe version – disables known background services and telemetry,
    turns off Game Bar, indexing, and unnecessary background apps,
    and enables High Performance power mode.
#>

Write-Host "Optimizing system for audio performance..." -ForegroundColor Cyan

# --- Power Plan ---
Write-Host "Setting High Performance power plan..."
powercfg -setactive SCHEME_MIN

# Optionally enable Ultimate Performance if supported
if ((powercfg -list) -notmatch "Ultimate Performance") {
    Write-Host "Enabling Ultimate Performance power plan..."
    powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61 | Out-Null
}
powercfg -setactive e9a42b02-d5df-448d-aa00-03f14749eb61

# --- Disable Windows Telemetry and Diagnostics ---
Write-Host "Disabling telemetry and diagnostic tracking..."
Stop-Service DiagTrack -ErrorAction SilentlyContinue
Set-Service DiagTrack -StartupType Disabled
Stop-Service dmwappushservice -ErrorAction SilentlyContinue
Set-Service dmwappushservice -StartupType Disabled

# --- Disable Windows Search Indexing ---
Write-Host "Disabling Windows Search indexing..."
Stop-Service WSearch -ErrorAction SilentlyContinue
Set-Service WSearch -StartupType Disabled

# --- Disable Background Apps (Store Apps) ---
Write-Host "Disabling background apps (Store Apps)..."
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /v GlobalUserDisabled /t REG_DWORD /d 1 /f | Out-Null

# --- Disable Game Bar / Game DVR ---
Write-Host "Disabling Game Bar and Game DVR..."
reg add "HKCU\Software\Microsoft\GameBar" /v "ShowStartupPanel" /t REG_DWORD /d 0 /f | Out-Null
reg add "HKCU\Software\Microsoft\GameBar" /v "AllowAutoGameMode" /t REG_DWORD /d 0 /f | Out-Null
reg add "HKCU\System\GameConfigStore" /v "GameDVR_Enabled" /t REG_DWORD /d 0 /f | Out-Null
reg add "HKLM\Software\Policies\Microsoft\Windows\GameDVR" /v "AllowGameDVR" /t REG_DWORD /d 0 /f | Out-Null

# --- Disable OneDrive Auto-Start ---
Write-Host "Disabling OneDrive auto start..."
reg add "HKCU\Software\Microsoft\OneDrive" /v "UserSettingSyncMigration" /t REG_DWORD /d 0 /f | Out-Null
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "OneDrive" /t REG_SZ /d "" /f | Out-Null

# --- Disable SysMain (Superfetch) ---
Write-Host "Disabling SysMain service..."
Stop-Service SysMain -ErrorAction SilentlyContinue
Set-Service SysMain -StartupType Disabled

# --- Disable Windows Tips / Suggestions / Ads ---
Write-Host "Disabling Windows tips, suggestions, and ads..."
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338388Enabled" /t REG_DWORD /d 0 /f | Out-Null
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338389Enabled" /t REG_DWORD /d 0 /f | Out-Null
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-353694Enabled" /t REG_DWORD /d 0 /f | Out-Null
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-353696Enabled" /t REG_DWORD /d 0 /f | Out-Null

# --- Disable Widgets (WebView2 runtime overhead) ---
Write-Host "Disabling Widgets..."
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarDa" /t REG_DWORD /d 0 /f | Out-Null

# --- Disable USB Power Saving ---
Write-Host "Disabling USB selective suspend..."
powercfg -change -standby-timeout-ac 0
powercfg -change -disk-timeout-ac 0
powercfg -change -monitor-timeout-ac 0
reg add "HKLM\SYSTEM\CurrentControlSet\Services\USB" /v DisableSelectiveSuspend /t REG_DWORD /d 1 /f | Out-Null

# --- Exclude Audio Folders from Defender ---
Write-Host "Excluding common DAW folders from Defender..."
Add-MpPreference -ExclusionPath "C:\Program Files\Bitwig Studio" -ErrorAction SilentlyContinue
Add-MpPreference -ExclusionPath "C:\VSTPlugins" -ErrorAction SilentlyContinue
Add-MpPreference -ExclusionPath "D:\Audio Projects" -ErrorAction SilentlyContinue

Write-Host "Optimization complete. Restart Windows to apply all changes." -ForegroundColor Green

Post

I think cyan is a bold choice
THIS MUSIC HAS BEEN MIXED TO BE PLAYED LOUD SO TURN IT UP

Post

The script does eleven different things. Discussing that is a can of worms.
Maybe cross-check with the advice from Pictus:
viewtopic.php?t=621326
We are the KVR collective. Resistance is futile. You will be assimilated. Image
My MusicCalc is served over https!!

Post

Looks surprisingly sane.

I'm not sure about the last step - that excluding the audio plugin directories is either useful (defender still churns through the rest of the system, so CPU and I/O cycles are still eaten at almost the same rate) nor wise (on a music workstation plugins are a prime attack surface).

Post

power shell has been removed from the latest Win11 update, FWIW.
MacPro 5,1 12core x 3.46ghz-96gb MacOS 12.2 (opencore), X32+AES16e-50

Post

Dewdman42 wrote: Sun Oct 26, 2025 5:41 pm power shell has been removed from the latest Win11 update, FWIW.
Fake news? No, merely leaving out some details: it's about the 2.0 version.
hothardware.com wrote: Although WMIC and PowerShell 2.0 have been removed from Windows, power users can get all the features of both by using Windows 11's built-in PowerShell 5.1. Those looking for even more advanced features can also download and install PowerShell 7.x.
We are the KVR collective. Resistance is futile. You will be assimilated. Image
My MusicCalc is served over https!!

Post

Dewdman42 wrote: Sun Oct 26, 2025 5:41 pm power shell has been removed from the latest Win11 update, FWIW.
PowerShell 2.0 was removed, yes. But PowerShell 5.1 is still there.
Mac Mini M4 Pro | 14 Cores (10P/4E) | 48GB RAM | Studio One | Reason | Bitwig Studio | Logic Pro | FL Studio | Cubase Pro | Waveform | Reaper | Renoise | ~1000 VSTs/AUs | ~350 REs

Post

I did not know that. thanks!
MacPro 5,1 12core x 3.46ghz-96gb MacOS 12.2 (opencore), X32+AES16e-50

Post

starflakeprj wrote: Sun Oct 26, 2025 6:12 pm
Dewdman42 wrote: Sun Oct 26, 2025 5:41 pm power shell has been removed from the latest Win11 update, FWIW.
PowerShell 2.0 was removed, yes. But PowerShell 5.1 is still there.
I use PowerShell every day at work (I run IT for a ~120 person org). I recommend installing/using PowerShell Core v7+ wherever possible. It's not 100% back-compatible but it's cross-platform (Win, Mac & Linux), actively developed, and essential if you need/want to automate actions in the cloud. I prefer using PowerShell 7 for those kinds of tasks over Bash/Unix scripting, as PowerShell modules have functions/objects for working with all sorts of resources.

To the OP:
- There is no malicious code contained in here, though like @uOpt I question the wisdom of excluding music folders from Defender scan, but this is moot if you use other AV/security tools.
HOWEVER - I recommend reading the comments (any line starting with a "#") to understand what it's actually doing. If you just run stuff without understanding it you could, for example, wonder why your computer runs down the battery more (possible effect from enabling High Performance Power Mode) or why it doesn't remember complex search terms like it used to (Deactivate Win Search Indexing).

- You may have to change the execution policy to run this, and won't be able to do so as a regular user. I won't give instructions, as doing this system-wide has security implications (if you want to research, it's an easy fix).

- I think it's worth figuring out how to do tasks like this least once using Windows Settings App, Registry Editor, and Services/Task Manager. It's not impossible or magic, you'll likely find other settings to tweak, and you'll gain the confidence to DIY in the future, and will much better grok scripts like this.

Post Reply

Return to “Computer Setup and System Configuration”