Compare commits

...

23 Commits

Author SHA1 Message Date
dado
56cc763c0e added new software 2025-10-18 18:27:02 +02:00
dado
4dc59971a8 deleted show smaller taskbar button 2025-10-18 16:13:39 +02:00
dado
f5d540ea4b commented set taskbar left align 2025-10-18 16:10:38 +02:00
dado
cbaac31ee8 setting small taskbar icons 2025-10-18 16:09:11 +02:00
dado
b61933fc31 minor changes 2025-10-18 16:02:48 +02:00
dado
e355ea3263 added HP Support Assistant 2025-10-18 15:12:01 +02:00
dado
b29c4dfa3b migliorato suddivisione in categorie 2025-10-18 15:10:34 +02:00
dado
d6449f5d8a eliminato windows update 2025-10-18 15:02:50 +02:00
dado
5462c96a01 eliminato Delivery Optimization 2025-10-18 14:58:36 +02:00
dado
293c025e62 minor changes 2025-10-18 14:51:09 +02:00
dado
a0fe8ff52a Turn Off Windows Update Delivery Optimization and force driver update 2025-10-18 14:49:42 +02:00
dado
1b95401e61 minor changes 2025-10-18 14:36:46 +02:00
dado
3ee88aac48 cambiato chiave di registro per disabilitare Lets finish setting up your device 2025-10-18 14:31:06 +02:00
dado
7674c670e8 aggiunti programmi e modifica chiave regedit per disabilitare finish setting up your device 2025-10-18 14:27:51 +02:00
dado
876a63c3d3 aggiunto controllo esistenza path. Se non esite, viene creato. RImosso apps doppie 2025-10-12 18:06:41 +02:00
dado
42562b8bec rimozione telemetria, corretto copia supremo su desktop pubblico, creato ciclo di verifica esistenza parametro di registro, corretto powerplan 2025-10-11 18:46:41 +02:00
dado
d627c54615 aggiunto nuovo bloatware 2025-10-11 18:45:30 +02:00
dado
60b4e73305 Turn off web results in the Start menu 2025-09-30 20:19:10 +02:00
dado
757b40c109 eliminato -Force, che risulta ambiguo in Install-WindowsUpdate 2025-09-29 22:11:45 +02:00
dado
faf132d017 minor changes 2025-09-28 19:14:40 +02:00
dado
e4438cb8a6 migliorato lo script, aggiungendo diverse sezioni, e testato il funzionamento 2025-09-28 19:13:06 +02:00
dado
99e6f9b237 aggiunto istruzioni per lesecuzione dello script 2025-09-28 19:12:27 +02:00
dado
96496d288e inserito varie app da rimuovere tramite winget 2025-09-28 19:11:49 +02:00
4 changed files with 719 additions and 242 deletions

View File

@@ -1,3 +1,13 @@
# powershell-script # powershell-script
A list of PowerShell scripts for configuring and debloating Windows A list of PowerShell scripts for configuring and debloating Windows.
## First run
To allow the execution of scripts, but only for the local user, run the following command in a PowerShell window:
```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
```
Scripts downloaded from the Internet must be signed by a trusted entity, while local scripts can be executed without restrictions. This setting applies exclusively to the current user and does not affect the execution policies of other users on the system.

View File

@@ -1,28 +0,0 @@
Microsoft.Windows.ParentalControls
Microsoft.Windows.PeopleExperienceHost
Microsoft.XboxGameCallableUI
Clipchamp.Clipchamp
Microsoft.BingNews
Microsoft.BingSearch
Microsoft.BingWeather
Microsoft.Edge.GameAssist
Microsoft.GamingApp
Microsoft.MicrosoftOfficeHub
Microsoft.MicrosoftSolitaireCollection
Microsoft.MicrosoftStickyNotes
Microsoft.WindowsCalculator
Microsoft.WindowsFeedbackHub
Microsoft.WindowsSoundRecorder
Microsoft.ZuneMusic
Microsoft.XboxIdentityProvider
Microsoft.ScreenSketch
Microsoft.Paint
Microsoft.StartExperiencesApp
Microsoft.WidgetsPlatformRuntime
Microsoft.Todos
Microsoft.PowerAutomateDesktop
MicrosoftCorporationII.QuickAssist
Microsoft.YourPhone
Microsoft.XboxSpeechToTextOverlay
Microsoft.XboxGamingOverlay
Microsoft.Xbox.TCUI

125
bloatware.txt Normal file
View File

@@ -0,0 +1,125 @@
9MSSGKG348SP
9NBLGGH42THS
ACGMediaPlayer
ActiproSoftwareLLC
AD2F1837.HPPCHardwareDiagnosticsWindows
AD2F1837.HPPowerManager
AD2F1837.HPPrivacySettings
AD2F1837.HPQuickDrop
AD2F1837.HPSupportAssistant
AD2F1837.HPSystemInformation
AD2F1837.myHP
AdobeSystemsIncorporated.AdobePhotoshopExpress
Amazon.com.Amazon
AmazonVideo.PrimeVideo
Asphalt8Airborne
AutodeskSketchBook
CaesarsSlotsFreeCasino
COOKINGFEVER
CyberLinkMediaSuiteEssentials
Dell Core Services
Dell Digital Delivery
Dell Digital Delivery Service
DellInc.DellCommandUpdate
DellInc.DellDigitalDelivery
DellInc.DellOptimizer
DellInc.DellPowerManager
DellInc.DellSupportAssistforPCs
DellInc.PartnerPromo
Dell Optimizer
Dell Optimizer Core
Dell Optimizer Service
DellOptimizerUI
Dell Pair
Dell Peripheral Manager
Dell Power Manager
Dell Power Manager Service
Dell SupportAssist
Dell SupportAssistAgent
Dell SupportAssist OS Recovery
Dell SupportAssist OS Recovery Plugin for Dell Update
Dell SupportAssist Remediation
Dell Update - SupportAssist Update Plugin
Dev Home
Disney
Disney+
DisneyMagicKingdoms
DrawboardPDF
Duolingo-LearnLanguagesforFree
EclipseManager
Facebook
FarmVille2CountryEscape
Feedback Hub
fitbit
Flipboard
Game Bar
Game Speech Window
HiddenCity
HP Client Security Manager
HP Insights
HP Insights Analytics
HP Insights Analytics Service
HP Notifications
HP Performance Advisor
HP Presence Video
HP Security Update Service
HP Support Assistant
HP Sure Recover
HP Sure Run Module
HP System Default Settings
HP Wolf Security
HP Wolf Security - Console
HULULLC.HULUPLUS
iHeartRadio
Instagram
king.com.BubbleWitch3Saga
king.com.CandyCrushSaga
king.com.CandyCrushSodaSaga
LinkedInforWindows
MarchofEmpires
Microsoft 365 Copilot
Microsoft 365 (Office)
Microsoft Bing
Microsoft Clipchamp
Microsoft Edge Game Assist
Microsoft News
Microsoft Photos
Microsoft Sticky Notes
Microsoft Teams
Microsoft To Do
MSN Weather
Netflix
News
NYTCrossword
OneCalendar
Outlook for Windows
Paint
PandoraMediaInc
Phone Link
PhototasticCollage
PicsArt-PhotoStudio
Plex
PolarrPhotoEditorAcademicEdition
Poly Lens
Power Automate
Royal Revolt
Shazam
Sidia.LiveWallpaper
SlingTV
Snipping Tool
Solitaire & Casual Games
Spotify
SupportAssist Recovery Assistant
TikTok
TuneInRadio
Viber
Widgets Platform Runtime
Windows Notepad
Windows Sound Recorder
Windows Web Experience Pack
WinZipUniversal
Wunderlist
Xbox
Xbox Identity Provider
Xbox TCUI
XING

View File

@@ -1,8 +1,6 @@
# https://github.com/andrew-s-taylor/public/blob/main/De-Bloat/RemoveBloat.ps1 # https://github.com/andrew-s-taylor/public/blob/main/De-Bloat/RemoveBloat.ps1
# https://github.com/marlock9/edge-debloat/blob/main/edge-debloat.reg # https://github.com/marlock9/edge-debloat/blob/main/edge-debloat.reg
# https://github.com/Raphire/Win11Debloat/tree/master/Regfiles
## TODO
# Taskbar settings, Edge and bloatware for all users
clear-Host clear-Host
@@ -13,64 +11,20 @@ if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdenti
} }
Write-Host "" Write-Host ""
Write-Host -ForegroundColor Yellow "### SCRIPT Write-Host -ForegroundColor Yellow "
FOR CONFIGURING
AND
DEBLOATING
WINDOWS 11 ###"
########################################################################################## ######################################################
# # # #
# Execution policy # # #
# # # SCRIPT FOR CONFIGURING AND DEBLOATING WINDOWS 11 #
########################################################################################## # #
# by dado #
######################################################
Write-Host "" "
# Check the current execution policy # Sleep for 2 seconds
$currentPolicy = Get-ExecutionPolicy -Scope LocalMachine Start-Sleep -Seconds 2
# Define the desired execution policy
$desiredPolicy = "RemoteSigned"
# If the current policy is not the desired one, change it
if ($currentPolicy -ne $desiredPolicy) {
# Change the policy (requires admin rights)
Set-ExecutionPolicy -ExecutionPolicy $desiredPolicy -Scope LocalMachine -Force | Out-Null
# Confirm the change
Write-Host -ForegroundColor Yellow "Execution policy changed to '$desiredPolicy'."
} else {
Write-Host -ForegroundColor DarkGreen "Current execution policy is already set to '$currentPolicy'."
}
# Sleep for 5 seconds
Start-Sleep -Seconds 5
clear-Host
##########################################################################################
# #
# Software #
# #
##########################################################################################
# https://winstall.app/ - Browse the winget repository
Write-Host ""
Write-Host -ForegroundColor Yellow ">>> Upgrade packages... <<<"
winget upgrade --all --disable-interactivity
Write-Host ""
Write-Host -ForegroundColor Yellow ">>> Install default software... <<<"
winget install --disable-interactivity Microsoft.PowerShell Adobe.Acrobat.Reader.64-bit IZArc.IZArc Oracle.JavaRuntimeEnvironment Google.Chrome 7zip.7zip Microsoft.VCRedist.2010.x64 --source winget
Write-Host ""
Write-Host -ForegroundColor DarkGray ">>> Copy 'Supremo' to Public Desktop <<<"
$supremo_path=".\supremo.exe"
If (Test-Path $supremo_path ) {
Copy-Item -Path "$supremo_path" -Destination "C:\Users\Public\Desktop\supremo.exe"
}
Write-Host ""
########################################################################################## ##########################################################################################
# # # #
@@ -81,35 +35,148 @@ Write-Host ""
# Taskbar Adjustment # Taskbar Adjustment
Write-Host -ForegroundColor Yellow ">>> Manage Taskbar <<<" Write-Host -ForegroundColor Yellow ">>> Manage Taskbar <<<"
Write-Host "" Write-Host ""
Write-Host -ForegroundColor DarkGray ">>> Set left align <<<"
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAl" -Value "0" -Type DWORD -Force | Out-Null
Write-Host -ForegroundColor DarkGray ">>> Hide search <<<" # Define registry paths for taskbar settings
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "SearchBoxTaskbarMode" -Value "0" -Type DWORD -Force | Out-Null $RegistryPaths = @(
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced",
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced",
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search",
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer",
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer"
)
# Loop through each registry path to check if it exists
foreach ($path in $RegistryPaths) {
if (-not (Test-Path $path)) {
New-Item -Path $path -Force | Out-Null
}
}
# Set left align
#Write-Host -ForegroundColor DarkGray ">>> Set left align <<<"
#foreach ($path in $RegistryPaths[0..1]) {
# New-ItemProperty -Path $path -Name "TaskbarAl" -Value 0 -Type DWORD -Force | Out-Null
#}
# Hide TaskView button
Write-Host -ForegroundColor DarkGray ">>> Hide TaskView button <<<" Write-Host -ForegroundColor DarkGray ">>> Hide TaskView button <<<"
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Value "0" -Type DWORD -Force | Out-Null foreach ($path in $RegistryPaths[0..1]) {
Set-ItemProperty -Path $path -Name "ShowTaskViewButton" -Value 0 -Type DWORD -Force | Out-Null
Write-Host -ForegroundColor DarkGray ">>> Disable widgets in the taskbar <<<" }
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarWidgetsEnabled" -Value "0" | Out-Null
Write-Host -ForegroundColor DarkGray ">>> Disable the 'Windows + W' keyboard shortcut to open widgets <<<"
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "ShowWindowsW" -Value "0" | Out-Null
# Remove Chat from the Taskbar
Write-Host -ForegroundColor DarkGray ">>> Removes Chat from the Taskbar <<<" Write-Host -ForegroundColor DarkGray ">>> Removes Chat from the Taskbar <<<"
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarMn" -Value "0" -PropertyType DWORD -Force | Out-Null foreach ($path in $RegistryPaths[0..1]) {
New-ItemProperty -Path $path -Name "TaskbarMn" -Value 0 -Type DWORD -Force | Out-Null
}
# Disable widgets in the taskbar
Write-Host -ForegroundColor DarkGray ">>> Disable widgets in the taskbar <<<"
Set-ItemProperty -Path $RegistryPaths[0] -Name "TaskbarWidgetsEnabled" -Value 0 | Out-Null
Set-ItemProperty -Path $RegistryPaths[1] -Name "TaskbarWidgetsEnabled" -Value 0 | Out-Null
# Hide search
Write-Host -ForegroundColor DarkGray ">>> Hide search <<<"
Set-ItemProperty -Path $RegistryPaths[2] -Name "SearchBoxTaskbarMode" -Value 0 -Type DWORD -Force | Out-Null
# Disable the 'Windows + W' keyboard shortcut to open widgets
Write-Host -ForegroundColor DarkGray ">>> Disable the 'Windows + W' keyboard shortcut to open widgets <<<"
Set-ItemProperty -Path $RegistryPaths[3] -Name "ShowWindowsW" -Value 0 | Out-Null
Set-ItemProperty -Path $RegistryPaths[4] -Name "ShowWindowsW" -Value 0 | Out-Null
# Disable the widget service
Write-Host -ForegroundColor DarkGray ">>> Disable widget service <<<"
$widgetPaths = @(
"HKLM:\SOFTWARE\Microsoft\PolicyManager\default\NewsAndInterests",
"HKLM:\SOFTWARE\Policies\Microsoft\Dsh"
)
foreach ($path in $widgetPaths) {
if (-not (Test-Path $path)) {
New-Item -Path $path -Force | Out-Null
}
Set-ItemProperty -Path $path -Name "AllowNewsAndInterests" -Value 0 -Type DWORD -Force | Out-Null
}
####################################################################################################################################
# Enable End Task
Write-Host -ForegroundColor DarkGray ">>> Enable End Task <<<"
$endTaskPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
# Create the path if it doesn't exist
if (-not (Test-Path $endTaskPath)) {
New-Item -Path $endTaskPath -Force | Out-Null
}
Set-ItemProperty -Path $endTaskPath -Name "TaskbarEndTask" -Value 1 -Type DWORD -Force | Out-Null
####################################################################################################################################
# Disabling 'Recommended' section
Write-Host -ForegroundColor DarkGray ">>> Hide 'Recommended' section <<<"
$explorerPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer"
$startPath = "HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Start"
$educationPath = "HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education"
# Create the Explorer path if it doesn't exist
if (-not (Test-Path $explorerPath)) {
New-Item -Path $explorerPath -Force | Out-Null
}
Set-ItemProperty -Path $explorerPath -Name "HideRecommendedSection" -Value 1 -Type DWORD -Force | Out-Null
# Create the Start path if it doesn't exist
if (-not (Test-Path $startPath)) {
New-Item -Path $startPath -Force | Out-Null
}
Set-ItemProperty -Path $startPath -Name "HideRecommendedSection" -Value 1 -Type DWORD -Force | Out-Null
# Create the Education path if it doesn't exist
if (-not (Test-Path $educationPath)) {
New-Item -Path $educationPath -Force | Out-Null
}
Set-ItemProperty -Path $educationPath -Name "IsEducationEnvironment" -Value 1 -Type DWORD -Force | Out-Null
Write-Host -ForegroundColor DarkGray ">>> Disabling 'Recommended' section <<<"
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Start_IrisRecommendations" -Value "0" -Type DWORD -Force | Out-Null
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Start_TrackDocs" -Value "0" -Type DWORD -Force | Out-Null
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Start_Layout" -Value "1" -Type DWORD -Force | Out-Null
Write-Host "" Write-Host ""
$taskbarDa_path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" ####################################################################################################################################
If (Test-Path $taskbarDa_path\TaskbarDa) {
Remove-ItemProperty "$taskbarDa_path" -Name "TaskbarDa" -Force | Out-Null # Turn off web results in the Start menu
Write-Host -ForegroundColor Yellow ">>> Turn off web results in the Start menu <<<"
# Set the registry paths
$RegistryPaths = @(
"HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Search",
"HKCU:SOFTWARE\Policies\Microsoft\Windows\Explorer"
)
$Properties = @{
"SearchboxTaskbarMode" = 0
"BingSearchEnabled" = 0
"DisableSearchBoxSuggestions" = 1
} }
# Iterate over each registry path
foreach ($RegistryPath in $RegistryPaths) {
# Create the key if it does not exist
if (-NOT (Test-Path $RegistryPath)) {
New-Item -Path $RegistryPath -Force | Out-Null
}
foreach ($Name in $Properties.Keys) {
$Value = $Properties[$Name]
New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -Type DWORD -Force | Out-Null
}
}
Write-Host ""
########################################################################################## ##########################################################################################
# # # #
# Explorer # # Explorer #
@@ -118,14 +185,65 @@ If (Test-Path $taskbarDa_path\TaskbarDa) {
Write-Host -ForegroundColor Yellow ">>> Configure File Explorer <<<" Write-Host -ForegroundColor Yellow ">>> Configure File Explorer <<<"
Write-Host "" Write-Host ""
Write-Host -ForegroundColor DarkGray ">>> Set File Explorer to Open to This PC Instead of Quick Access <<<" Write-Host -ForegroundColor DarkGray ">>> Open 'This PC' instead of 'Quick Access' <<<"
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Value "1" -Type DWORD -Force | Out-Null
Write-Host -ForegroundColor DarkGray ">>> Enable Compact View <<<" Write-Host -ForegroundColor DarkGray ">>> Enable Compact View <<<"
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "UseCompactMode" -Value "1" -Force | Out-Null Write-Host -ForegroundColor DarkGray ">>> Show file extensions <<<"
Write-Host -ForegroundColor DarkGray ">>> Show file extensions in Explorer <<<" # Set the registry paths for both HKLM and HKCU
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Value "0" -Type DWORD -Force | Out-Null $RegistryPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced",
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
)
# Create a hashtable to store the property names and their corresponding values
$ExplorerProperties = @{
"LaunchTo" = 1
"UseCompactMode" = 1
"HideFileExt" = 0
}
foreach ($RegistryPath in $RegistryPaths) {
if (-NOT (Test-Path $RegistryPath)) {
New-Item -Path $RegistryPath -Force | Out-Null
}
foreach ($Name in $ExplorerProperties.Keys) {
$Value = $ExplorerProperties[$Name]
New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -Type DWORD -Force | Out-Null
}
}
####################################################################################################################################
# Disable Group By Folder in Windows Explorer
Write-Host -ForegroundColor DarkGray ">>> Disabling Group By Folder feature <<<"
$groupByPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
# Create the path if it doesn't exist
if (-not (Test-Path $groupByPath)) {
New-Item -Path $groupByPath -Force | Out-Null
}
# Set the registry value to disable auto grouping
Set-ItemProperty -Path $groupByPath -Name "UseAutoGrouping" -Value 0 -Type DWORD -Force | Out-Null
####################################################################################################################################
# Enable Dark Mode in Windows
Write-Host -ForegroundColor DarkGray ">>> Enable Dark Mode <<<"
$darkModePath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
# Create the path if it doesn't exist
if (-not (Test-Path $darkModePath)) {
New-Item -Path $darkModePath -Force | Out-Null
}
# Set the registry values to enable dark mode
Set-ItemProperty -Path $darkModePath -Name "AppsUseLightTheme" -Value 0 -Type DWORD -Force | Out-Null
Set-ItemProperty -Path $darkModePath -Name "SystemUsesLightTheme" -Value 0 -Type DWORD -Force | Out-Null
Write-Host ""
########################################################################################## ##########################################################################################
# # # #
@@ -133,28 +251,228 @@ New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer
# # # #
########################################################################################## ##########################################################################################
Write-Host ""
Write-Host -ForegroundColor Yellow ">>> Disable Spotlight <<<" Write-Host -ForegroundColor Yellow ">>> Disable Spotlight <<<"
Write-Host "" Write-Host ""
# Define registry paths for Windows Spotlight settings
$RegistryPaths = @(
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager",
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager",
"HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent",
"HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
)
# Define properties for lockscreen
$LockScreenProperties = @{
"RotatingLockScreenOverlayEnabled" = 0
"RotatingLockScreenEnabled" = 0
}
# Define properties for background
$BackgroundProperties = @{
"DisableSpotlightCollectionOnDesktop" = 1
"DisableWindowsSpotlightFeatures" = 1
}
# Disable Windows Spotlight on lockscreen
Write-Host -ForegroundColor DarkGray ">>> Disabling Windows Spotlight on lockscreen <<<" Write-Host -ForegroundColor DarkGray ">>> Disabling Windows Spotlight on lockscreen <<<"
$spotlight = "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" foreach ($spotlight in $RegistryPaths[0..1]) {
If (Test-Path $spotlight) { if (Test-Path $spotlight) {
Set-ItemProperty $spotlight -Name "RotatingLockScreenOverlayEnabled" -Value "0" foreach ($Name in $LockScreenProperties.Keys) {
Set-ItemProperty $spotlight -Name "RotatingLockScreenEnabled" -Value "0" $Value = $LockScreenProperties[$Name]
Set-ItemProperty -Path $spotlight -Name $Name -Value $Value -Force | Out-Null
}
}
} }
# Disable Windows Spotlight on background
Write-Host -ForegroundColor DarkGray ">>> Disabling Windows Spotlight on background <<<" Write-Host -ForegroundColor DarkGray ">>> Disabling Windows Spotlight on background <<<"
$spotlight = "HKCU:\Software\Policies\Microsoft\Windows\CloudContent" foreach ($spotlight in $RegistryPaths[2..3]) {
If (Test-Path $spotlight) { if (Test-Path $spotlight) {
Set-ItemProperty $spotlight -Name "DisableSpotlightCollectionOnDesktop" -Value "1" foreach ($Name in $BackgroundProperties.Keys) {
Set-ItemProperty $spotlight -Name "DisableWindowsSpotlightFeatures" -Value "1" $Value = $BackgroundProperties[$Name]
Set-ItemProperty -Path $spotlight -Name $Name -Value $Value -Force | Out-Null
}
}
} }
Write-Host "" Write-Host ""
##########################################################################################
# #
# Telemetry #
# #
##########################################################################################
# Configure Windows telemetry and activity tracking settings
Write-Host -ForegroundColor Yellow ">>> Disable some telemetry <<<"
$registryPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection",
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced",
"HKLM:\SOFTWARE\Policies\Microsoft\Windows\System",
"HKCU:\SOFTWARE\Microsoft\Siuf\Rules"
)
$TelemetryProperties = @{
"AllowTelemetry" = 0
"PublishUserActivities" = 0
}
$ActivityTrackingProperties = @{
"Start_TrackProgs" = 0
"NumberOfSIUFInPeriod" = 0
"PeriodInNanoSeconds" = -1
}
# Disable telemetry settings
foreach ($path in $registryPaths[0..1]) {
if (-not (Test-Path $path)) {
New-Item -Path $path -Force | Out-Null
}
foreach ($Name in $TelemetryProperties.Keys) {
$Value = $TelemetryProperties[$Name]
Set-ItemProperty -Path $path -Name $Name -Value $Value -Type DWORD -Force | Out-Null
}
}
# Disable activity tracking settings
foreach ($path in $registryPaths[2..3]) {
if (-not (Test-Path $path)) {
New-Item -Path $path -Force | Out-Null
}
foreach ($Name in $ActivityTrackingProperties.Keys) {
$Value = $ActivityTrackingProperties[$Name]
Set-ItemProperty -Path $path -Name $Name -Value $Value -Type DWORD -Force | Out-Null
}
}
Write-Host ""
##########################################################################################
# #
# Suggestion #
# #
##########################################################################################
# Disable Windows notifications, suggestions, and ads
Write-Host -ForegroundColor DarkGray ">>> Turn off Welcome Experience, notifications, suggestions, and ads in Windows <<<"
# Define registry paths and values to modify
$registryEntries = @(
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"; Name = "SubscribedContent-310093Enabled"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"; Name = "SubscribedContent-338388Enabled"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"; Name = "SystemPaneSuggestionsEnabled"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"; Name = "SubscribedContent-338389Enabled"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"; Name = "SoftLandingEnabled"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"; Name = "SubscribedContent-338393Enabled"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"; Name = "SubscribedContent-353694Enabled"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"; Name = "SubscribedContent-353696Enabled"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"; Name = "SubscribedContent-353698Enabled"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications"; Name = "EnableAccountNotifications"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\UserProfileEngagement"; Name = "ScoobeSystemSettingEnabled"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; Name = "ShowSyncProviderNotifications"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"; Name = "SilentInstalledAppsEnabled"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.Suggested"; Name = "Enabled"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Mobility"; Name = "OptedIn"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; Name = "Start_AccountNotifications"; Value = 0 }
)
# Loop through each registry entry and set the values
foreach ($entry in $registryEntries) {
# Create the path if it doesn't exist
if (-not (Test-Path $entry.Path)) {
New-Item -Path $entry.Path -Force | Out-Null
}
Set-ItemProperty -Path $entry.Path -Name $entry.Name -Value $entry.Value -Type DWORD -Force | Out-Null
}
##########################################################################################
# #
# Recall #
# #
##########################################################################################
Write-Host -ForegroundColor DarkGray ">>> Disable Recall <<<"
# Define registry paths for taskbar settings
$RegistryPaths = @(
"HKCU:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI",
"HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI"
)
# Loop through each registry path to check if it exists
foreach ($path in $RegistryPaths) {
# Check if the path does not exist
if (-not (Test-Path $path)) {
New-Item -Path $path -Force | Out-Null # Create the registry path
}
}
# Disable AI data analysis
Write-Host -ForegroundColor DarkGray ">>> Disable AI data analysis <<<"
foreach ($path in $RegistryPaths[0..1]) {
New-ItemProperty -Path $path -Name "DisableAIDataAnalysis" -Value 1 -Type DWORD -Force | Out-Null
}
Set-ItemProperty -Path $RegistryPaths[1] -Name "AllowRecallEnablement" -Value 0 -Type DWORD -Force | Out-Null
# Turn off Recall snapshots
Write-Host -ForegroundColor DarkGray ">>> Turn off Recall snapshots <<<"
Set-ItemProperty -Path $RegistryPaths[1] -Name "TurnOffSavingSnapshots" -Value 1 -Type DWORD -Force | Out-Null
Write-Host ""
##########################################################################################
# #
# Lock Screen Notifications #
# #
##########################################################################################
Write-Host -ForegroundColor Yellow ">>> Disable Notifications on Lock Screen <<<" Write-Host -ForegroundColor Yellow ">>> Disable Notifications on Lock Screen <<<"
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings" -Name "NOC_GLOBAL_SETTING_ALLOW_TOASTS_ABOVE_LOCK" -Value "0" -Type DWORD -Force | Out-Null
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "LockScreenToastEnabled" -Value "0" -Type DWORD -Force | Out-Null # Set the registry paths for notifications settings
$RegistryPaths = @(
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings",
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings",
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications",
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications"
)
# Create a hashtable to store the property names and their corresponding values
$NotificationProperties = @{
"NOC_GLOBAL_SETTING_ALLOW_TOASTS_ABOVE_LOCK" = 0
"LockScreenToastEnabled" = 0
}
foreach ($RegistryPath in $RegistryPaths) {
if (-NOT (Test-Path $RegistryPath)) {
New-Item -Path $RegistryPath -Force | Out-Null
}
foreach ($Name in $NotificationProperties.Keys) {
$Value = $NotificationProperties[$Name]
New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -Type DWORD -Force | Out-Null
}
}
Write-Host ""
####################################################################################################################################
Write-Host -ForegroundColor Yellow ">>> Disable Lets finish setting up your device <<<"
$RegistryPaths = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"
# Check if the path exists
if (-not (Test-Path $RegistryPaths)) {
# Create the path if it doesn't exist
New-Item -Path $RegistryPaths -Force | Out-Null
}
Set-ItemProperty -Path $RegistryPaths -Name "SubscribedContent-338389Enabled" -Value 0 -Force | Out-Null
Write-Host ""
########################################################################################## ##########################################################################################
# # # #
@@ -162,12 +480,30 @@ New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNoti
# # # #
########################################################################################## ##########################################################################################
Write-Host "" Write-Host -ForegroundColor Yellow ">>> Change Control Panel View to 'Small icon'<<<"
Write-Host -ForegroundColor DarkGray ">>> Change Control Panel View <<<"
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" -Name "AllItemsIconView" -Value "1" -Type DWORD -Force | Out-Null $RegistryPaths = @(
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" -Name "StartupPage" -Value "1" -Type DWORD -Force | Out-Null "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel",
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" -Name "AllItemsIconView" -Value "1" -Type DWORD -Force | Out-Null "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel"
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" -Name "StartupPage" -Value "1" -Type DWORD -Force | Out-Null )
# Create a hashtable to store the property names and their corresponding values
$ControlPanelProperties = @{
"AllItemsIconView" = 1
"StartupPage" = 1
}
foreach ($RegistryPath in $RegistryPaths) {
if (-NOT (Test-Path $RegistryPath)) {
New-Item -Path $RegistryPath -Force | Out-Null
}
foreach ($Name in $ControlPanelProperties.Keys) {
$Value = $ControlPanelProperties[$Name]
New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -Type DWORD -Force | Out-Null
}
}
Write-Host "" Write-Host ""
########################################################################################## ##########################################################################################
@@ -177,47 +513,56 @@ Write-Host ""
########################################################################################## ##########################################################################################
Write-Host -ForegroundColor Yellow ">>> Disable Microsoft Edge First Run Welcome Page <<<" Write-Host -ForegroundColor Yellow ">>> Disable Microsoft Edge First Run Welcome Page <<<"
# Set variables to indicate value and key to set
$RegistryPath = "HKLM:\SOFTWARE\Policies\Microsoft\Edge"
$Name = "HideFirstRunExperience"
$Value = "1"
# Create the key if it does not exist
If (-NOT (Test-Path $RegistryPath)) {
New-Item -Path $RegistryPath -Force | Out-Null
}
# Now set the value
New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType DWORD -Force | Out-Null
Write-Host ""
########################################################################################## # Set the registry paths
# # $RegistryPaths = @(
# Export Registry # "HKLM:\SOFTWARE\Policies\Microsoft\Edge",
# # "HKCU:\SOFTWARE\Policies\Microsoft\Edge"
########################################################################################## )
# Export the registry keys # https://gist.github.com/asheroto/e18500e7d206f3ae99f9bd0da0cf6bc6
Write-Host -ForegroundColor DarkGray ">>> Exporting registry settings... <<<" $EdgeProperties = @{
"AlternateErrorPagesEnabled" = 0
# Create a temporary folder for export "ComposeInlineEnabled" = 0
$exportPath = "C:\temp" "CopilotCDPPageContext" = 0
if (-Not (Test-Path $exportPath)) { "CopilotPageContext" = 0
New-Item -ItemType Directory -Path $exportPath | Out-Null "DefaultBrowserSettingsCampaignEnabled" = 0
"DiagnosticData" = 0
"EdgeCollectionsEnabled" = 0
"EdgeEntraCopilotPageContext" = 0
"EdgeHistoryAISearchEnabled" = 0
"EdgeShoppingAssistantEnabled" = 0
"GenAILocalFoundationalModelSettings" = 1
"HideFirstRunExperience" = 1
"HubsSidebarEnabled" = 0
"Microsoft365CopilotChatIconEnabled" = 0
"NewTabPageAllowedBackgroundTypes" = 3
"NewTabPageAppLauncherEnabled" = 0
"NewTabPageBingChatEnabled" = 0
"NewTabPageContentEnabled" = 0
"NewTabPageHideDefaultTopSites" = 1
"PersonalizationReportingEnabled" = 0
"PersonalizeTopSitesInCustomizeSidebarEnabled" = 0
"ShowAcrobatSubscriptionButton" = 0
"ShowMicrosoftRewards" = 0
"ShowRecommendationsEnabled" = 0
"TabServicesEnabled" = 0
"UserFeedbackAllowed" = 0
"VisualSearchEnabled" = 0
} }
reg export "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "$exportPath\TaskbarSettings.reg" /y | Out-Null # Iterate over each registry path
reg export "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" "$exportPath\SearchSettings.reg" /y | Out-Null foreach ($RegistryPath in $RegistryPaths) {
if (-NOT (Test-Path $RegistryPath)) {
New-Item -Path $RegistryPath -Force | Out-Null
}
Write-Host -ForegroundColor DarkGray ">>> Importing registry settings to Default Profile <<<" foreach ($Name in $EdgeProperties.Keys) {
$Value = $EdgeProperties[$Name]
New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -Type DWORD -Force | Out-Null
}
}
# Copy the registry files to the default profile
Copy-Item "$exportPath\TaskbarSettings.reg" "C:\Users\Default\Desktop"
Copy-Item "$exportPath\SearchSettings.reg" "C:\Users\Default\Desktop"
# Remove the temporary folder
Remove-Item -Path $exportPath -Recurse -Force
Write-Host -ForegroundColor DarkGray ">>> Unpin Microsoft Store <<<"
((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -eq "Microsoft Store"}).Verbs() | ?{$_.Name.replace('&','') -match 'Unpin from taskbar'} | %{$_.DoIt(); $exec = $true}
Write-Host "" Write-Host ""
########################################################################################## ##########################################################################################
@@ -228,10 +573,15 @@ Write-Host ""
Write-Host -ForegroundColor Yellow ">>> Power Plan <<<" Write-Host -ForegroundColor Yellow ">>> Power Plan <<<"
Write-Host "" Write-Host ""
Write-Host -ForegroundColor DarkGray ">>> Activate High performance power plan <<<"
$powerPlan = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerPlan -Filter "ElementName = 'High Performance'"
$powerPlan.Activate()
Write-Host -ForegroundColor DarkGray ">>> Activate High performance power plan <<<"
powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
# Create ultimate powerscheme
powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61 | Out-Null
####################################################################################################################################
Write-Host -ForegroundColor DarkGray ">>> Setting the monitor timeout to 10 minutes <<<"
# AC power # AC power
powercfg -change -monitor-timeout-ac 10 powercfg -change -monitor-timeout-ac 10
powercfg -change -standby-timeout-ac 10 powercfg -change -standby-timeout-ac 10
@@ -244,6 +594,8 @@ powercfg -change -hibernate-timeout-dc 0
powercfg -change -disk-timeout-dc 0 powercfg -change -disk-timeout-dc 0
powercfg /hibernate off powercfg /hibernate off
####################################################################################################################################
# Set the power button behavior for AC power to "Shut down" # Set the power button behavior for AC power to "Shut down"
Write-Host -ForegroundColor DarkGray ">>> Setting the power button behavior to 'Shut down' <<<" Write-Host -ForegroundColor DarkGray ">>> Setting the power button behavior to 'Shut down' <<<"
powercfg -setacvalueindex SCHEME_CURRENT SUB_BUTTONS PBUTTONACTION 3 powercfg -setacvalueindex SCHEME_CURRENT SUB_BUTTONS PBUTTONACTION 3
@@ -254,30 +606,38 @@ Write-Host -ForegroundColor DarkGray ">>> Setting the sleep button behavior to '
powercfg /SETACVALUEINDEX SCHEME_CURRENT SUB_BUTTONS SBUTTONACTION 0 powercfg /SETACVALUEINDEX SCHEME_CURRENT SUB_BUTTONS SBUTTONACTION 0
powercfg /SETDCVALUEINDEX SCHEME_CURRENT SUB_BUTTONS SBUTTONACTION 0 powercfg /SETDCVALUEINDEX SCHEME_CURRENT SUB_BUTTONS SBUTTONACTION 0
Write-Host -ForegroundColor DarkGray ">>> Disabling fast startup <<<" ####################################################################################################################################
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power" -Name HiberbootEnabled -Value "0" -Force | Out-Null
# Disable Fast Startup
Write-Host -ForegroundColor DarkGray ">>> Disable fast startup <<<"
$RegistryPaths = "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power"
# Check if the path exists
if (-not (Test-Path $RegistryPaths)) {
# Create the path if it doesn't exist
New-Item -Path $RegistryPaths -Force | Out-Null
}
Set-ItemProperty -Path $RegistryPaths -Name "HiberbootEnabled" -Value 0 -Force | Out-Null
####################################################################################################################################
Write-Host -ForegroundColor DarkGray ">>> Disable Energy-Efficient Ethernet <<<" Write-Host -ForegroundColor DarkGray ">>> Disable Energy-Efficient Ethernet <<<"
$adapter = Get-NetAdapter | Where-Object { $_.Name -eq "Ethernet" } $adapter = Get-NetAdapter | Where-Object { $_.Name -eq "Ethernet" }
Disable-NetAdapterPowerManagement -Name $adapter.Name -NoRestart Disable-NetAdapterPowerManagement -Name $adapter.Name -NoRestart
Set-ItemProperty -Path ("HKLM:\SYSTEM\CurrentControlSet\Control\Class\{0}\{1}" -f "{4D36E972-E325-11CE-BFC1-08002BE10318}", $idNIC) -Name "PnPCapabilities" -Value "24" -Type DWORD -Force | Out-Null Set-ItemProperty -Path ("HKLM:\SYSTEM\CurrentControlSet\Control\Class\{0}\{1}" -f "{4D36E972-E325-11CE-BFC1-08002BE10318}", $idNIC) -Name "PnPCapabilities" -Value "24" -Type DWORD -Force | Out-Null
Write-Host "" Write-Host ""
########################################################################################## ##########################################################################################
# # # #
# Windows Update # # Windows Update Setting #
# # # #
########################################################################################## ##########################################################################################
Write-Host -ForegroundColor Yellow ">>> Windows Update settings <<<" Write-Host -ForegroundColor Yellow ">>> Windows Update settings <<<"
Write-Host "" Write-Host ""
Write-Host -ForegroundColor DarkGray ">>> Enable 'Get updates for other Microsoft products' <<<" Write-Host -ForegroundColor DarkGray ">>> Enable 'Get updates for other Microsoft products' <<<"
# Check if the script is running as administrator
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Error -ForegroundColor Red "This script must be run with administrator privileges."
exit
}
try { try {
$UpdateServiceManager = New-Object -ComObject "Microsoft.Update.ServiceManager" $UpdateServiceManager = New-Object -ComObject "Microsoft.Update.ServiceManager"
@@ -285,80 +645,29 @@ try {
$UpdateServiceManager.AddService2($ServiceID, 7, "") | Out-Null $UpdateServiceManager.AddService2($ServiceID, 7, "") | Out-Null
} }
catch { catch {
Write-Error "An error occurred while configuring Microsoft Update: $($_.Exception.Message)" Write-Error -ForegroundColor Red "An error occurred while configuring Microsoft Update: $($_.Exception.Message)"
}
Write-Host -ForegroundColor DarkGray ">>> Set the notification behavior for updates to 'Do not show any notifications (excluding restart notifications)' <<<"
$RegistryPath = "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings"
$RegistryName = "ConfigureNotificationsForWU"
$RegistryValue = 0 # Do not show any notifications (excluding restart notifications)
# Explanation of values for ConfigureNotificationsForWU:
# 0: Do not show any notifications (excluding restart notifications)
# 1: Show standard notifications (includes restart alerts)
# 2: Notify for download and installation
# 3: Disable all notifications
# Check if the script is running as administrator
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Error -ForegroundColor Red "This script must be run with administrator privileges."
exit
} }
try { ####################################################################################################################################
# Check if the registry path exists
if (-not (Test-Path -Path $RegistryPath)) {
Write-Warning "The registry path '$RegistryPath' does not exist."
Write-Host "Windows Update may need to be initialized."
exit
}
# Set the registry value
Set-ItemProperty -Path $RegistryPath -Name $RegistryName -Value $RegistryValue -Force
}
catch {
Write-Error "An error occurred while modifying the registry: $($_.Exception.Message)"
}
# Set "Do not restart if user is logged on" # Set "Do not restart if user is logged on"
Write-Host -ForegroundColor DarkGray ">>> Set 'Do not restart if user is logged on' <<<" Write-Host -ForegroundColor DarkGray ">>> Set 'Do not restart if user is logged on' <<<"
# Define the value to disable automatic reboots when a user is logged on
$NoAutoRebootWithLoggedOnUsers = 1
# Registry path for Windows Update
$WindowsUpdateRegistryPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" $WindowsUpdateRegistryPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update"
# Check if the registry key exists, otherwise create it
if (!(Test-Path $WindowsUpdateRegistryPath)) { if (!(Test-Path $WindowsUpdateRegistryPath)) {
New-Item -Path $WindowsUpdateRegistryPath -Force | Out-Null New-Item -Path $WindowsUpdateRegistryPath -Force | Out-Null
} }
# Set the NoAutoRebootWithLoggedOnUsers value Set-ItemProperty -Path $WindowsUpdateRegistryPath -Name "NoAutoRebootWithLoggedOnUsers" -Value 1 -Type DWORD | Out-Null
Set-ItemProperty -Path $WindowsUpdateRegistryPath -Name "NoAutoRebootWithLoggedOnUsers" -Value $NoAutoRebootWithLoggedOnUsers -Type DWORD | Out-Null
# Check if the setting has been applied correctly ####################################################################################################################################
$CheckValue = Get-ItemProperty -Path $WindowsUpdateRegistryPath -Name "NoAutoRebootWithLoggedOnUsers"
# Restart the Windows Update service to apply the change immediately
Restart-Service -Name "wuauserv" -Force | Out-Null
# Restart File Explorer to apply the changes # Restart File Explorer to apply the changes
taskkill /f /im explorer.exe | Out-Null taskkill /f /im explorer.exe | Out-Null
start explorer.exe | Out-Null start explorer.exe | Out-Null
# Checking for Available Updates
Install-Module -Name PSWindowsUpdate -Force -Confirm:$False
Write-Host ""
Write-Host -ForegroundColor Yellow ">>> Checking for Available Updates... <<<"
Get-WindowsUpdate
Write-Host ""
# Installing Windows Updates
Write-Host -ForegroundColor Yellow ">>> Installing Windows Updates... <<<"
Install-WindowsUpdate -AcceptAll
# Monitoring Update Installation
# Write-Host ""
# Get-WindowsUpdateLog
Write-Host "" Write-Host ""
########################################################################################## ##########################################################################################
@@ -370,26 +679,87 @@ Write-Host ""
Write-Host -ForegroundColor Yellow ">>> Starting the process to remove unnecessary bloatware applications... <<<" Write-Host -ForegroundColor Yellow ">>> Starting the process to remove unnecessary bloatware applications... <<<"
Write-Host "" Write-Host ""
# Read the content of the bloatware-list.txt file # Get the directory of the currently executing script
$appsToRemove = Get-Content (Join-Path $env:USERPROFILE "Desktop\bloatware-list.txt") $scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Path
# bloatware.txt path
$appsToRemove = Get-Content (Join-Path $scriptDirectory "bloatware.txt")
# Remove the specified apps from the list # Remove the specified apps from the list
foreach ($app in $appsToRemove) { foreach ($app in $appsToRemove) {
try { try {
Get-AppxPackage -Name $app | Remove-AppxPackage -AllUsers -ErrorAction Stop winget uninstall --name $app | Out-Null
Write-Host "Removed: $app" # Check if the app was removed successfully
if ($LASTEXITCODE -eq 0) {
Write-Host "Removed: $app"
}
else {
Write-Host "Not found: $app"
}
} catch { } catch {
Write-Host "Error removing: $app. Details: $_" Write-Host -ForegroundColor Red "Error removing: $app. Details: $_"
} }
} }
Write-Host -ForegroundColor Yellow ">>> Uninstallation of Microsoft Office <<<" ####################################################################################################################################
# Disable Microsoft 365 Ads in Settings Home
$RegistryPaths = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
# Create the path if it doesn't exist
if (-not (Test-Path $RegistryPaths)) {
New-Item -Path $RegistryPaths -Force | Out-Null
}
# Set the registry value to disable ads
Set-ItemProperty -Path $RegistryPaths -Name "DisableConsumerAccountStateContent" -Value 1 -Type DWORD -Force | Out-Null
####################################################################################################################################
# Uninstall Microsoft Office
Write-Host ""
Write-Host -ForegroundColor Yellow ">>> Uninstall Microsoft Office <<<"
Start-Process "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" "https://aka.ms/SaRA-officeUninstallFromPC" Start-Process "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" "https://aka.ms/SaRA-officeUninstallFromPC"
##########################################################################################
# #
# SOFTWARE #
# #
##########################################################################################
# https://winstall.app/ - Browse the winget repository
Write-Host ""
Write-Host -ForegroundColor Yellow ">>> Upgrade packages... <<<"
Write-Host ""
winget upgrade --all
Write-Host "" Write-Host ""
# Write-Host -ForegroundColor Yellow ">>> Retrieving the list of installed Win32 programs... <<<" Write-Host -ForegroundColor Yellow ">>> Install default SOFTWARE... <<<"
# List of Win32 programs Write-Host ""
# Get-WmiObject -Class Win32_Product | Select-Object -Property Name winget install --disable-interactivity SumatraPDF.SumatraPDF Microsoft.Edit Notepad++.Notepad++ 7zip.7zip Mozilla.Firefox Flameshot.Flameshot DuongDieuPhap.ImageGlass Microsoft.PowerToys Seelen.SeelenUI voidtools.Everything Flow-Launcher.Flow-Launcher --source winget
# Microsoft.PowerShell NodirTemirkhodjaev.FortFirewall AutoHotkey.AutoHotkey Oracle.JavaRuntimeEnvironment Microsoft.VCRedist.2010.x64
####################################################################################################################################
#Write-Host -ForegroundColor DarkGray ">>> Copy 'Supremo' to Public Desktop <<<"
## Get the directory where the script is located
#$scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Path
## Define the path to the supremo executable
#$supremo_path = Join-Path $scriptDirectory "supremo.exe"
#
#if (Test-Path $supremo_path ) {
# Copy-Item -Path "$supremo_path" -Destination "C:\Users\Public\Desktop\supremo.exe"
#} else {
# Write-Host -ForegroundColor Red "Error: File '$supremo_path' does not exist."
#}
Write-Host ""
##########################################################################################
# #
# End #
# #
##########################################################################################
# Show the message # Show the message
Write-Host -ForegroundColor Cyan ">>> Press any key to continue... <<<" Write-Host -ForegroundColor Cyan ">>> Press any key to continue... <<<"