Skip to content

Commit

Permalink
Added option to disable gameDVR, clearing start now backs up old file…
Browse files Browse the repository at this point in the history
… + more

Added new option to disable Game DVR. (Raphire#62)
Clearing the start menu now creates a backup of the current start menu file. (Raphire#60)
Fixed unnecessarily setting path variable in Get.ps1 in some situations (Raphire#59)
  • Loading branch information
Raphire committed May 24, 2024
1 parent 9401de8 commit 6ec319b
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 8 deletions.
7 changes: 4 additions & 3 deletions Get.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ param (
[switch]$RemoveCommApps,
[switch]$RemoveDevApps,
[switch]$RemoveW11Outlook,
[switch]$DisableDVR,
[switch]$DisableTelemetry,
[switch]$DisableBingSearches, [switch]$DisableBing,
[switch]$DisableLockscrTips, [switch]$DisableLockscreenTips,
Expand Down Expand Up @@ -51,16 +52,16 @@ if ((Get-AppxPackage -Name "*Microsoft.DesktopAppInstaller*") -and ((winget -v)
{
Write-Output "> Installing git..."
winget install git.git --accept-package-agreements --accept-source-agreements --disable-interactivity --no-upgrade

# Add default install location of git to path
$env:Path += ';C:\Program Files\Git\cmd'

Write-Output ""
}

# Navigate to user temp directory
cd $env:TEMP

# Add default install location of git to path
$env:Path += ';C:\Program Files\Git\cmd'

# Download Win11Debloat from github
Write-Output "> Downloading Win11Debloat..."
git clone https://github.com/Raphire/Win11Debloat/
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ The quick and advanced method support parameters to tailor the behaviour of the
| -RemoveW11Outlook | Remove the new Outlook for Windows app. |
| -RemoveDevApps | Remove developer-related apps such as Remote Desktop, DevHome and Power Automate. |
| -RemoveGamingApps | Remove the Xbox App and Xbox Gamebar. |
| -DisableDVR | Disable Xbox game DVR. |
| -ClearStart | Remove all pinned apps from the start menu. NOTE: This applies to all existing and new users. (Windows 11 update 22H2 or later only) |
| -DisableTelemetry | Disable telemetry, diagnostic data & targeted ads. |
| -DisableBing | Disable & remove bing search, bing AI & cortana in Windows search. |
Expand Down
7 changes: 7 additions & 0 deletions Regfiles/Disable_DVR.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\System\GameConfigStore]
"GameDVR_Enabled"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR]
"AllowGameDVR"=dword:00000000
7 changes: 7 additions & 0 deletions Regfiles/Undo/Enable_DVR.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\System\GameConfigStore]
"GameDVR_Enabled"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR]
"AllowGameDVR"=dword:00000001
27 changes: 22 additions & 5 deletions Win11Debloat.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ param (
[switch]$RemoveCommApps,
[switch]$RemoveDevApps,
[switch]$RemoveW11Outlook,
[switch]$DisableDVR,
[switch]$DisableTelemetry,
[switch]$DisableBingSearches, [switch]$DisableBing,
[switch]$DisableLockscrTips, [switch]$DisableLockscreenTips,
Expand Down Expand Up @@ -406,9 +407,14 @@ function ClearStartMenu {
# Copy Start menu to all users folders
ForEach ($startmenu in $usersStartMenu) {
$startmenuBinFile = $startmenu.Fullname + "\start2.bin"
$backupBinFile = $startmenuBinFile + ".bak"

# Check if bin file exists
if (Test-Path $startmenuBinFile) {
# Backup current startmenu file
Move-Item -Path $startmenuBinFile -Destination $backupBinFile

# Copy template file
Copy-Item -Path $startmenuTemplate -Destination $startmenu -Force

$cpyMsg = "Replaced start menu for user " + $startmenu.Fullname.Split("\")[2]
Expand Down Expand Up @@ -696,11 +702,18 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP
AddParameter 'RemoveW11Outlook' 'Remove the new Outlook for Windows app'
AddParameter 'RemoveDevApps' 'Remove developer-related apps'
AddParameter 'RemoveGamingApps' 'Remove the Xbox App and Xbox Gamebar'
AddParameter 'DisableDVR' 'Disable Xbox game DVR'
}
'3' {
Write-Output "You have selected $($global:SelectedApps.Count) apps for removal"

AddParameter 'RemoveAppsCustom' "Remove $($global:SelectedApps.Count) apps:"

Write-Output ""

if ($( Read-Host -Prompt "Disable Xbox game DVR? (y/n)" ) -eq 'y') {
AddParameter 'DisableDVR' 'Disable Xbox game DVR'
}
}
}

Expand All @@ -721,15 +734,15 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP

Write-Output ""

if ($( Read-Host -Prompt "Disable & remove bing search, bing AI & cortana in Windows search? (y/n)" ) -eq 'y') {
AddParameter 'DisableBing' 'Disable & remove bing search, bing AI & cortana in Windows search'
if ($( Read-Host -Prompt "Disable tips, tricks, suggestions and ads in start, settings, notifications, explorer and lockscreen? (y/n)" ) -eq 'y') {
AddParameter 'DisableSuggestions' 'Disable tips, tricks, suggestions and ads in start, settings, notifications and Windows explorer'
AddParameter 'DisableLockscreenTips' 'Disable tips & tricks on the lockscreen'
}

Write-Output ""

if ($( Read-Host -Prompt "Disable tips, tricks, suggestions and ads in start, settings, notifications, explorer and lockscreen? (y/n)" ) -eq 'y') {
AddParameter 'DisableSuggestions' 'Disable tips, tricks, suggestions and ads in start, settings, notifications and Windows explorer'
AddParameter 'DisableLockscreenTips' 'Disable tips & tricks on the lockscreen'
if ($( Read-Host -Prompt "Disable & remove bing search, bing AI & cortana in Windows search? (y/n)" ) -eq 'y') {
AddParameter 'DisableBing' 'Disable & remove bing search, bing AI & cortana in Windows search'
}

# Only show this option for Windows 11 users running build 22621 or later
Expand Down Expand Up @@ -1055,6 +1068,10 @@ else {

continue
}
'DisableDVR' {
RegImport "> Disabling Xbox game DVR..." $PSScriptRoot\Regfiles\Disable_DVR.reg
continue
}
'ClearStart' {
ClearStartMenu "> Removing all pinned apps from the start menu..."
continue
Expand Down

0 comments on commit 6ec319b

Please sign in to comment.