mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 02:56:17 +00:00
Added support for running the script with arguments, this removes the need for any user input at runtime and makes it easies to run the script with custom settings. Also some major refactoring in Win10Debloat.ps1
This commit is contained in:
37
README.md
37
README.md
@@ -11,15 +11,40 @@ You can pick and choose which modifications you want the script to make, but the
|
||||
- Disable tips, tricks and suggestions in the startmenu and settings.
|
||||
- Disable the 'Include in library' from context menu.
|
||||
- Disable the 'Give access to' from context menu.
|
||||
- Disable the 'Share' from context menu.
|
||||
- Disable the 'Share' from context menu. (Does not remove the onedrive share option)
|
||||
|
||||
### Or select the 'Advanced' option in the menu to customize the script to your needs.
|
||||
|
||||
## Usage
|
||||
1. [Download the script](https://github.com/Raphire/Win10Debloat/archive/master.zip), and extract the .ZIP file to your desired location.
|
||||
### Easy method:
|
||||
1. [Download the latest version of the script](https://github.com/Raphire/Win10Debloat/archive/master.zip), and extract the .ZIP file to your desired location.
|
||||
2. Run the script by right-clicking the 'Run.ps1' file and selecting 'Run with Powershell' option.
|
||||
3. Accept the windows UAC prompt to run the script as administrator, this is required for the script to function.
|
||||
4. Select either default, or advanced setup depending on what changes you want to make. Advanced setup will allow you to choose exactly which changes you want to make, and which changes you want to skip.
|
||||
5. Once the script has executed, restart your pc to ensure all changes are properly applied.
|
||||
|
||||
### Advanced method:
|
||||
This method is a bit more complicated, but it gives you the option to run the script with certain arguments to tailor the behaviour of the script to your specific needs. It also has the added benefit that the script will run without requiring any user input during runtime, allowing you to automate the process.
|
||||
1. [Download the latest version of the script](https://github.com/Raphire/Win10Debloat/archive/master.zip), and extract the .ZIP file to your desired location.
|
||||
2. Open powershell as an administrator.
|
||||
3. Enable powershell execution by entering the following command: <code>Set-ExecutionPolicy Unrestricted -Force</code>
|
||||
4. In powershell, navigate to the directory where the files were extracted. Example: <code>cd c:\\Win10Debloat</code>
|
||||
5. Enter this into powershell to run the script: <code>.\Win10Debloat.ps1</code> To run the script with arguments simply add them at the end, as can be seen in this example: <code>.\Win10Debloat.ps1 -RemoveApps -DisableBingSearches</code>
|
||||
|
||||
| Argument | Description |
|
||||
| --------- | ----------- |
|
||||
| -RunDefaults | Run the script with default settings. |
|
||||
| -RemoveApps | Remove all bloatware apps from [this list](#these-apps-will-be-deleted-by-default). |
|
||||
| -DisableOnedrive | Hide the onedrive folder in the windows explorer sidebar. |
|
||||
| -Disable3dObjects | Hide the 3D objects folder under 'This pc' in windows explorer. |
|
||||
| -DisableMusic | Hide the music folder under 'This pc' in windows explorer. |
|
||||
| -DisableBingSearches | Disable bing in windows search. |
|
||||
| -DisableLockscreenTips | Disable tips & tricks on the lockscreen. |
|
||||
| -DisableWindowsSuggestions | Disable tips, tricks and suggestions in the startmenu and settings. |
|
||||
| -DisableIncludeInLibrary | Disable the 'Include in library' option in the context menu. |
|
||||
| -DisableGiveAccessTo | Disable the 'Give access to' option in the context menu. |
|
||||
| -DisableShare | Disable the 'Share' option in the context menu. |
|
||||
|
||||
## Debloat Windows 10
|
||||
By default, this script will remove most, but not all of the pre-installed windows 10 applications. You customize which applications are removed by this script by editing the apps list found in the 'Win10Debloat.ps1' file.
|
||||
|
||||
@@ -69,7 +94,7 @@ By default, this script will remove most, but not all of the pre-installed windo
|
||||
- Microsoft.XboxGameOverlay
|
||||
- Microsoft.XboxGamingOverlay
|
||||
- Microsoft.XboxIdentityProvider
|
||||
- Microsoft.XboxSpeechToTextOverlay (NOTE: This app may not be able to be reinstalled!)
|
||||
- Microsoft.XboxSpeechToTextOverlay (NOTE: This app cannot be reinstalled from the microsoft store!)
|
||||
|
||||
## Declutter Windows 10
|
||||
This script can also make various changes to declutter windows 10, such as:
|
||||
@@ -79,8 +104,8 @@ This script can also make various changes to declutter windows 10, such as:
|
||||
- Disable bing in windows search.
|
||||
- Disable tips & tricks on the lockscreen. (This changes your lockscreen wallpaper to the windows default)
|
||||
- Disable tips, tricks and suggestions in the startmenu and settings.
|
||||
- Disable the 'Include in library' from context menu.
|
||||
- Disable the 'Give access to' from context menu.
|
||||
- Disable the 'Share' from context menu.
|
||||
- Disable the 'Include in library' option in the context menu.
|
||||
- Disable the 'Give access to' option in the context menu.
|
||||
- Disable the 'Share' from context menu. (Does not remove the onedrive share option)
|
||||
|
||||
All of these changes can be reverted with the registry files that are included in the 'Regfiles' folder.
|
||||
|
||||
32
Run.ps1
32
Run.ps1
@@ -1,3 +1,33 @@
|
||||
Write-Output "Attempting to launch script with admin privileges..."
|
||||
|
||||
PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Unrestricted -File ""$PSScriptRoot\Win10Debloat.ps1""' -Verb RunAs}";
|
||||
PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile
|
||||
-ExecutionPolicy Unrestricted
|
||||
-File ""$PSScriptRoot\Win10Debloat.ps1""'
|
||||
-Verb RunAs}";
|
||||
|
||||
<#------------------------------------------------------------------------------------------------------------------------------------------------>
|
||||
It's possible to tweak the behaviour of the script by adding arguments to the ArgumentList, a full list of arguments is shown below.
|
||||
This has the added benefit that the script will run without requiring any user input during runtime, allowing you to automate the process.
|
||||
|
||||
The example below configures the script to only remove apps and disable bing in windows search:
|
||||
|
||||
PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile
|
||||
-ExecutionPolicy Unrestricted
|
||||
-File ""$PSScriptRoot\Win10Debloat.ps1""
|
||||
-RemoveApps
|
||||
-DisableBingSearches'
|
||||
-Verb RunAs}";
|
||||
|
||||
Supported Arguments:
|
||||
-RunDefaults | Run the script with default settings
|
||||
-RemoveApps | Remove configured apps
|
||||
-DisableOnedrive | Hide the onedrive folder in the windows explorer sidebar.
|
||||
-Disable3dObjects | Hide the 3D objects folder under 'This pc' in windows explorer.
|
||||
-DisableMusic | Hide the music folder under 'This pc' in windows explorer.
|
||||
-DisableBingSearches | Disable bing in windows search.
|
||||
-DisableLockscreenTips | Disable tips & tricks on the lockscreen.
|
||||
-DisableWindowsSuggestions | Disable tips, tricks and suggestions in the startmenu and settings.
|
||||
-DisableIncludeInLibrary | Disable the 'Include in library' option in the context menu.
|
||||
-DisableGiveAccessTo | Disable the 'Give access to' option in the context menu.
|
||||
-DisableShare | Disable the 'Share' option in the context menu.
|
||||
<------------------------------------------------------------------------------------------------------------------------------------------------#>
|
||||
228
Win10Debloat.ps1
228
Win10Debloat.ps1
@@ -1,44 +1,21 @@
|
||||
Write-Output "-------------------------------------------------------------------------------------------"
|
||||
Write-Output "Win10Debloat Script - Setup"
|
||||
Write-Output "-------------------------------------------------------------------------------------------"
|
||||
Write-Output "(1) Run Win10Debloat with the default settings"
|
||||
Write-Output "(2) Advanced: Choose which changes you want Win10Debloat to make"
|
||||
Write-Output ""
|
||||
Do { $script_mode = Read-Host "Please select an option (1/2)" }
|
||||
while ($script_mode -ne '1' -and $script_mode -ne '2')
|
||||
[CmdletBinding(SupportsShouldProcess)]
|
||||
param
|
||||
(
|
||||
[Parameter(ValueFromPipeline=$true)][switch]$RunDefaults,
|
||||
[Parameter(ValueFromPipeline=$true)][switch]$RemoveApps,
|
||||
[Parameter(ValueFromPipeline=$true)][switch]$DisableOnedrive,
|
||||
[Parameter(ValueFromPipeline=$true)][switch]$Disable3dObjects,
|
||||
[Parameter(ValueFromPipeline=$true)][switch]$DisableMusic,
|
||||
[Parameter(ValueFromPipeline=$true)][switch]$DisableBingSearches,
|
||||
[Parameter(ValueFromPipeline=$true)][switch]$DisableLockscreenTips,
|
||||
[Parameter(ValueFromPipeline=$true)][switch]$DisableWindowsSuggestions,
|
||||
[Parameter(ValueFromPipeline=$true)][switch]$DisableIncludeInLibrary,
|
||||
[Parameter(ValueFromPipeline=$true)][switch]$DisableGiveAccessTo,
|
||||
[Parameter(ValueFromPipeline=$true)][switch]$DisableShare
|
||||
)
|
||||
|
||||
|
||||
if ($script_mode -eq '1'){
|
||||
Clear
|
||||
Write-Output "-------------------------------------------------------------------------------------------"
|
||||
Write-Output "Win10Debloat Script - Default Configuration"
|
||||
Write-Output "-------------------------------------------------------------------------------------------"
|
||||
}
|
||||
elseif ($script_mode -eq '2') {
|
||||
Clear
|
||||
Write-Output "-------------------------------------------------------------------------------------------"
|
||||
Write-Output "Win10Debloat Script - Advanced Configuration"
|
||||
Write-Output "-------------------------------------------------------------------------------------------"
|
||||
$remove_apps = Read-Host "Remove the pre-installed windows 10 apps? (y/n)"
|
||||
|
||||
$disable_onedrive = Read-Host "Hide the onedrive folder in windows explorer? (y/n)"
|
||||
|
||||
$disable_3d_objects = Read-Host "Hide the 3D objects folder in windows explorer? (y/n)"
|
||||
|
||||
$disable_music = Read-Host "Hide the music folder in windows explorer? (y/n)"
|
||||
|
||||
$disable_bing_searches = Read-Host "Disable bing in windows search? (y/n)"
|
||||
|
||||
$disable_lockscreen_tips = Read-Host "Disable tips & tricks on the lockscreen? (y/n)"
|
||||
|
||||
$disable_windows_suggestions = Read-Host "Disable tips, tricks and suggestions in the startmenu and settings? (y/n)"
|
||||
|
||||
$disable_context = Read-Host "Disable the contextmenu entries for: Share, Give access to and Include in library? (y/n)"
|
||||
|
||||
Write-Output ""
|
||||
}
|
||||
|
||||
if ($remove_apps -eq 'y' -or $script_mode -eq '1') {
|
||||
function RemoveApps
|
||||
{
|
||||
Write-Output "> Removing pre-installed windows 10 apps..."
|
||||
|
||||
$apps = @(
|
||||
@@ -106,49 +83,166 @@ if ($remove_apps -eq 'y' -or $script_mode -eq '1') {
|
||||
}
|
||||
}
|
||||
|
||||
if ($disable_onedrive -eq 'y') {
|
||||
Write-Output "> Hiding the onedrive folder in windows explorer..."
|
||||
function RegImport
|
||||
{
|
||||
param
|
||||
(
|
||||
$Message,
|
||||
$Path
|
||||
)
|
||||
|
||||
regedit /s $PSScriptRoot\Regfiles\Hide_Onedrive_Folder.reg
|
||||
Write-Output $Message
|
||||
reg import $path
|
||||
}
|
||||
|
||||
if((-NOT $PSBoundParameters.Count) -or $RunDefaults -or (($PSBoundParameters.Count -eq 1) -and ($PSBoundParameters.ContainsKey('WhatIf') -or $PSBoundParameters.ContainsKey('Confirm') -or $PSBoundParameters.ContainsKey('Verbose'))))
|
||||
{
|
||||
if($RunDefaults)
|
||||
{
|
||||
$Mode = '1';
|
||||
}
|
||||
else
|
||||
{
|
||||
Clear
|
||||
Write-Output "-------------------------------------------------------------------------------------------"
|
||||
Write-Output " Win10Debloat Script - Setup"
|
||||
Write-Output "-------------------------------------------------------------------------------------------"
|
||||
Write-Output "(1) Run Win10Debloat with the default settings"
|
||||
Write-Output "(2) Advanced: Choose which changes you want Win10Debloat to make"
|
||||
Write-Output ""
|
||||
|
||||
if ($disable_3d_objects -eq 'y' -or $script_mode -eq '1') {
|
||||
Write-Output "> Hiding the 3D objects folder in windows explorer..."
|
||||
|
||||
regedit /s $PSScriptRoot\Regfiles\Hide_3D_Objects_Folder.reg
|
||||
Do { $Mode = Read-Host "Please select an option (1/2)" }
|
||||
while ($Mode -ne '1' -and $Mode -ne '2')
|
||||
}
|
||||
|
||||
if ($disable_music -eq 'y') {
|
||||
Write-Output "> Hiding the music folder in windows explorer..."
|
||||
switch($Mode)
|
||||
{
|
||||
'1'
|
||||
{
|
||||
Clear
|
||||
Write-Output "-------------------------------------------------------------------------------------------"
|
||||
Write-Output " Win10Debloat Script - Default Configuration"
|
||||
Write-Output "-------------------------------------------------------------------------------------------"
|
||||
$PSBoundParameters.Add('RemoveApps', $RemoveApps)
|
||||
$PSBoundParameters.Add('Disable3dObjects', $Disable3dObjects)
|
||||
$PSBoundParameters.Add('DisableBingSearches', $DisableBingSearches)
|
||||
$PSBoundParameters.Add('DisableLockscreenTips', $DisableLockscreenTips)
|
||||
$PSBoundParameters.Add('DisableWindowsSuggestions', $DisableWindowsSuggestions)
|
||||
$PSBoundParameters.Add('DisableIncludeInLibrary', $DisableIncludeInLibrary)
|
||||
$PSBoundParameters.Add('DisableGiveAccessTo', $DisableGiveAccessTo)
|
||||
$PSBoundParameters.Add('DisableShare', $DisableShare)
|
||||
}
|
||||
'2'
|
||||
{
|
||||
Clear
|
||||
Write-Output "-------------------------------------------------------------------------------------------"
|
||||
Write-Output " Win10Debloat Script - Advanced Configuration"
|
||||
Write-Output "-------------------------------------------------------------------------------------------"
|
||||
|
||||
regedit /s $PSScriptRoot\Regfiles\Hide_Music_folder.reg
|
||||
if($( Read-Host -Prompt "Remove the pre-installed windows 10 apps? (y/n)" ) -eq 'y')
|
||||
{
|
||||
$PSBoundParameters.Add('RemoveApps', $RemoveApps)
|
||||
}
|
||||
|
||||
if ($disable_bing_searches -eq 'y' -or $script_mode -eq '1') {
|
||||
Write-Output "> Disabling bing in windows search..."
|
||||
|
||||
regedit /s $PSScriptRoot\Regfiles\Disable_Bing_Searches.reg
|
||||
if($( Read-Host -Prompt "Hide the onedrive folder in windows explorer? (y/n)" ) -eq 'y')
|
||||
{
|
||||
$PSBoundParameters.Add('DisableOnedrive', $DisableOnedrive)
|
||||
}
|
||||
|
||||
if ($disable_lockscreen_tips -eq 'y' -or $script_mode -eq '1') {
|
||||
Write-Output "> Disabling tips & tricks on the lockscreen..."
|
||||
|
||||
regedit /s $PSScriptRoot\Regfiles\Disable_Lockscreen_Tips.reg
|
||||
if($( Read-Host -Prompt "Hide the 3D objects folder in windows explorer? (y/n)" ) -eq 'y')
|
||||
{
|
||||
$PSBoundParameters.Add('Disable3dObjects', $Disable3dObjects)
|
||||
}
|
||||
|
||||
if ($disable_windows_suggestions -eq 'y' -or $script_mode -eq '1') {
|
||||
Write-Output "> Disabling tips, tricks and suggestions in the startmenu and settings..."
|
||||
|
||||
regedit /s $PSScriptRoot\Regfiles\Disable_Windows_Suggestions.reg
|
||||
if($( Read-Host -Prompt "Hide the music folder in windows explorer? (y/n)" ) -eq 'y')
|
||||
{
|
||||
$PSBoundParameters.Add('DisableMusic', $DisableMusic)
|
||||
}
|
||||
|
||||
if ($disable_context -eq 'y' -or $script_mode -eq '1') {
|
||||
Write-Output "> Disabling contextmenu entries for: Share, Include in library & Give access..."
|
||||
if($( Read-Host -Prompt "Disable bing in windows search? (y/n)" ) -eq 'y')
|
||||
{
|
||||
$PSBoundParameters.Add('DisableBingSearches', $DisableBingSearches)
|
||||
}
|
||||
|
||||
regedit /s $PSScriptRoot\Regfiles\Disable_Share_from_context_menu.reg
|
||||
regedit /s $PSScriptRoot\Regfiles\Disable_Include_in_library_from_context_menu.reg
|
||||
regedit /s $PSScriptRoot\Regfiles\Disable_Give_access_to_context_menu.reg
|
||||
if($( Read-Host -Prompt "Disable tips & tricks on the lockscreen? (y/n)" ) -eq 'y')
|
||||
{
|
||||
$PSBoundParameters.Add('DisableLockscreenTips', $DisableLockscreenTips)
|
||||
}
|
||||
|
||||
if($( Read-Host -Prompt "Disable tips, tricks and suggestions in the startmenu and settings? (y/n)" ) -eq 'y')
|
||||
{
|
||||
$PSBoundParameters.Add('DisableWindowsSuggestions', $DisableWindowsSuggestions)
|
||||
}
|
||||
|
||||
if($( Read-Host -Prompt "Disable the 'Include in library' option in the context menu? (y/n)" ) -eq 'y')
|
||||
{
|
||||
$PSBoundParameters.Add('DisableIncludeInLibrary', $DisableIncludeInLibrary)
|
||||
}
|
||||
|
||||
if($( Read-Host -Prompt "Disable the 'Give access to' option in the context menu? (y/n)" ) -eq 'y')
|
||||
{
|
||||
$PSBoundParameters.Add('DisableGiveAccessTo', $DisableGiveAccessTo)
|
||||
}
|
||||
|
||||
if($( Read-Host -Prompt "Disable the 'Share' option in the context menu? (y/n)" ) -eq 'y')
|
||||
{
|
||||
$PSBoundParameters.Add('DisableShare', $DisableShare)
|
||||
}
|
||||
|
||||
Write-Output ""
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Clear
|
||||
Write-Output "-------------------------------------------------------------------------------------------"
|
||||
Write-Output " Win10Debloat Script - Custom Configuration"
|
||||
Write-Output "-------------------------------------------------------------------------------------------"
|
||||
}
|
||||
|
||||
switch ($PSBoundParameters.Keys)
|
||||
{
|
||||
'RemoveApps'
|
||||
{
|
||||
RemoveApps
|
||||
}
|
||||
'DisableOnedrive'
|
||||
{
|
||||
RegImport "> Hiding the onedrive folder in windows explorer..." $PSScriptRoot\Regfiles\Hide_Onedrive_Folder.reg
|
||||
}
|
||||
'Disable3dObjects'
|
||||
{
|
||||
RegImport "> Hiding the 3D objects folder in windows explorer..." $PSScriptRoot\Regfiles\Hide_3D_Objects_Folder.reg
|
||||
}
|
||||
'DisableMusic'
|
||||
{
|
||||
RegImport "> Hiding the music folder in windows explorer..." $PSScriptRoot\Regfiles\Hide_Music_folder.reg
|
||||
}
|
||||
'DisableBingSearches'
|
||||
{
|
||||
RegImport "> Disabling bing in windows search..." $PSScriptRoot\Regfiles\Disable_Bing_Searches.reg
|
||||
}
|
||||
'DisableLockscreenTips'
|
||||
{
|
||||
RegImport "> Disabling tips & tricks on the lockscreen..." $PSScriptRoot\Regfiles\Disable_Lockscreen_Tips.reg
|
||||
}
|
||||
'DisableWindowsSuggestions'
|
||||
{
|
||||
RegImport "> Disabling tips, tricks and suggestions in the startmenu and settings..." $PSScriptRoot\Regfiles\Disable_Windows_Suggestions.reg
|
||||
}
|
||||
'DisableIncludeInLibrary'
|
||||
{
|
||||
RegImport "> Disabling 'Include in library' in the context menu..." $PSScriptRoot\Regfiles\Disable_Include_in_library_from_context_menu.reg
|
||||
}
|
||||
'DisableGiveAccessTo'
|
||||
{
|
||||
RegImport "> Disabling 'Give access to' in the context menu..." $PSScriptRoot\Regfiles\Disable_Give_access_to_context_menu.reg
|
||||
}
|
||||
'DisableShare'
|
||||
{
|
||||
RegImport "> Disabling 'Share' in the context menu..." $PSScriptRoot\Regfiles\Disable_Share_from_context_menu.reg
|
||||
}
|
||||
}
|
||||
|
||||
Write-Output ""
|
||||
|
||||
Reference in New Issue
Block a user