Compare commits

..

15 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
2 changed files with 296 additions and 238 deletions

View File

@@ -63,6 +63,7 @@ HP Notifications
HP Performance Advisor HP Performance Advisor
HP Presence Video HP Presence Video
HP Security Update Service HP Security Update Service
HP Support Assistant
HP Sure Recover HP Sure Recover
HP Sure Run Module HP Sure Run Module
HP System Default Settings HP System Default Settings
@@ -79,15 +80,14 @@ MarchofEmpires
Microsoft 365 Copilot Microsoft 365 Copilot
Microsoft 365 (Office) Microsoft 365 (Office)
Microsoft Bing Microsoft Bing
Microsoft Bing
Microsoft Clipchamp Microsoft Clipchamp
Microsoft Edge Game Assist Microsoft Edge Game Assist
Microsoft News Microsoft News
Microsoft Photos
Microsoft Sticky Notes Microsoft Sticky Notes
Microsoft Teams Microsoft Teams
Microsoft To Do Microsoft To Do
MSN Weather MSN Weather
MSN Weather
Netflix Netflix
News News
NYTCrossword NYTCrossword

View File

@@ -13,18 +13,18 @@ if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdenti
Write-Host "" Write-Host ""
Write-Host -ForegroundColor Yellow " Write-Host -ForegroundColor Yellow "
###################################################### ######################################################
# # # #
# # # #
# SCRIPT FOR CONFIGURING AND DEBLOATING WINDOWS 11 # # SCRIPT FOR CONFIGURING AND DEBLOATING WINDOWS 11 #
# # # #
# by dado # # by dado #
###################################################### ######################################################
" "
# Sleep for 5 seconds # Sleep for 2 seconds
Start-Sleep -Seconds 5 Start-Sleep -Seconds 2
########################################################################################## ##########################################################################################
# # # #
@@ -45,15 +45,18 @@ $RegistryPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer"
) )
# Set left align # Loop through each registry path to check if it exists
Write-Host -ForegroundColor DarkGray ">>> Set left align <<<" foreach ($path in $RegistryPaths) {
foreach ($path in $RegistryPaths[0..1]) { if (-not (Test-Path $path)) {
New-ItemProperty -Path $path -Name "TaskbarAl" -Value 0 -Type DWORD -Force | Out-Null New-Item -Path $path -Force | Out-Null
}
} }
# Hide search # Set left align
Write-Host -ForegroundColor DarkGray ">>> Hide search <<<" #Write-Host -ForegroundColor DarkGray ">>> Set left align <<<"
Set-ItemProperty -Path $RegistryPaths[2] -Name "SearchBoxTaskbarMode" -Value 0 -Type DWORD -Force | Out-Null #foreach ($path in $RegistryPaths[0..1]) {
# New-ItemProperty -Path $path -Name "TaskbarAl" -Value 0 -Type DWORD -Force | Out-Null
#}
# Hide TaskView button # Hide TaskView button
Write-Host -ForegroundColor DarkGray ">>> Hide TaskView button <<<" Write-Host -ForegroundColor DarkGray ">>> Hide TaskView button <<<"
@@ -61,11 +64,21 @@ foreach ($path in $RegistryPaths[0..1]) {
Set-ItemProperty -Path $path -Name "ShowTaskViewButton" -Value 0 -Type DWORD -Force | Out-Null Set-ItemProperty -Path $path -Name "ShowTaskViewButton" -Value 0 -Type DWORD -Force | Out-Null
} }
# Remove Chat from the Taskbar
Write-Host -ForegroundColor DarkGray ">>> Removes Chat from the Taskbar <<<"
foreach ($path in $RegistryPaths[0..1]) {
New-ItemProperty -Path $path -Name "TaskbarMn" -Value 0 -Type DWORD -Force | Out-Null
}
# Disable widgets in the taskbar # Disable widgets in the taskbar
Write-Host -ForegroundColor DarkGray ">>> 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[0] -Name "TaskbarWidgetsEnabled" -Value 0 | Out-Null
Set-ItemProperty -Path $RegistryPaths[1] -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 # Disable the 'Windows + W' keyboard shortcut to open widgets
Write-Host -ForegroundColor DarkGray ">>> 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[3] -Name "ShowWindowsW" -Value 0 | Out-Null
@@ -73,40 +86,37 @@ Set-ItemProperty -Path $RegistryPaths[4] -Name "ShowWindowsW" -Value 0 | Out-Nul
# Disable the widget service # Disable the widget service
Write-Host -ForegroundColor DarkGray ">>> Disable widget service <<<" Write-Host -ForegroundColor DarkGray ">>> Disable widget service <<<"
$widgetPath1 = "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\NewsAndInterests"
$widgetPath2 = "HKLM:\SOFTWARE\Policies\Microsoft\Dsh"
# Create the path if it doesn't exist $widgetPaths = @(
if (-not (Test-Path $widgetPath1)) { "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\NewsAndInterests",
New-Item -Path $widgetPath1 -Force | Out-Null "HKLM:\SOFTWARE\Policies\Microsoft\Dsh"
} )
if (-not (Test-Path $widgetPath2)) {
New-Item -Path $widgetPath2 -Force | Out-Null 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
} }
# Set the registry key ####################################################################################################################################
Set-ItemProperty -Path $widgetPath1 -Name "AllowNewsAndInterests" -Value 0 -Type DWORD -Force | Out-Null
New-ItemProperty -Path $widgetPath2 -Name "AllowNewsAndInterests" -Value 0 -Type DWORD -Force | Out-Null
# Enable End Task # Enable End Task
Write-Host -ForegroundColor DarkGray ">>> Enable End Task <<<" Write-Host -ForegroundColor DarkGray ">>> Enable End Task <<<"
$endTaskPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" $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 Set-ItemProperty -Path $endTaskPath -Name "TaskbarEndTask" -Value 1 -Type DWORD -Force | Out-Null
# Remove Chat from the Taskbar ####################################################################################################################################
Write-Host -ForegroundColor DarkGray ">>> Removes Chat from the Taskbar <<<"
foreach ($path in $RegistryPaths[0..1]) {
New-ItemProperty -Path $path -Name "TaskbarMn" -Value 0 -PropertyType DWORD -Force | Out-Null
}
# Disabling 'Recommended' section # Disabling 'Recommended' section
Write-Host -ForegroundColor DarkGray ">>> Hide 'Recommended' section <<<" Write-Host -ForegroundColor DarkGray ">>> Hide 'Recommended' section <<<"
foreach ($path in $RegistryPaths) {
New-ItemProperty -Path $path -Name "Start_IrisRecommendations" -Value 0 -Type DWORD -Force | Out-Null
New-ItemProperty -Path $path -Name "Start_TrackDocs" -Value 0 -Type DWORD -Force | Out-Null
New-ItemProperty -Path $path -Name "Start_Layout" -Value 1 -Type DWORD -Force | Out-Null
}
$explorerPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer" $explorerPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer"
$startPath = "HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Start" $startPath = "HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Start"
@@ -116,24 +126,27 @@ $educationPath = "HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Educatio
if (-not (Test-Path $explorerPath)) { if (-not (Test-Path $explorerPath)) {
New-Item -Path $explorerPath -Force | Out-Null New-Item -Path $explorerPath -Force | Out-Null
} }
# Set the registry value to hide the Recommended Section in Explorer
Set-ItemProperty -Path $explorerPath -Name "HideRecommendedSection" -Value 1 -Type DWORD -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 # Create the Start path if it doesn't exist
if (-not (Test-Path $startPath)) { if (-not (Test-Path $startPath)) {
New-Item -Path $startPath -Force | Out-Null New-Item -Path $startPath -Force | Out-Null
} }
# Set the registry value to hide the Recommended Section in Start
Set-ItemProperty -Path $startPath -Name "HideRecommendedSection" -Value 1 -Type DWORD -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 # Create the Education path if it doesn't exist
if (-not (Test-Path $educationPath)) { if (-not (Test-Path $educationPath)) {
New-Item -Path $educationPath -Force | Out-Null New-Item -Path $educationPath -Force | Out-Null
} }
# Set the registry value for Education Environment
Set-ItemProperty -Path $educationPath -Name "IsEducationEnvironment" -Value 1 -Type DWORD -Force | Out-Null Set-ItemProperty -Path $educationPath -Name "IsEducationEnvironment" -Value 1 -Type DWORD -Force | Out-Null
Write-Host "" Write-Host ""
####################################################################################################################################
# Turn off web results in the Start menu # Turn off web results in the Start menu
Write-Host -ForegroundColor Yellow ">>> Turn off web results in the Start menu <<<" Write-Host -ForegroundColor Yellow ">>> Turn off web results in the Start menu <<<"
@@ -152,14 +165,13 @@ $Properties = @{
# Iterate over each registry path # Iterate over each registry path
foreach ($RegistryPath in $RegistryPaths) { foreach ($RegistryPath in $RegistryPaths) {
# Create the key if it does not exist # Create the key if it does not exist
If (-NOT (Test-Path $RegistryPath)) { if (-NOT (Test-Path $RegistryPath)) {
New-Item -Path $RegistryPath -Force | Out-Null New-Item -Path $RegistryPath -Force | Out-Null
} }
# Set the values based on the hashtable
foreach ($Name in $Properties.Keys) { foreach ($Name in $Properties.Keys) {
$Value = $Properties[$Name] $Value = $Properties[$Name]
New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType DWORD -Force | Out-Null New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -Type DWORD -Force | Out-Null
} }
} }
@@ -190,50 +202,55 @@ $ExplorerProperties = @{
"HideFileExt" = 0 "HideFileExt" = 0
} }
# Iterate over each registry path
foreach ($RegistryPath in $RegistryPaths) { foreach ($RegistryPath in $RegistryPaths) {
# Create the key if it does not exist if (-NOT (Test-Path $RegistryPath)) {
If (-NOT (Test-Path $RegistryPath)) {
New-Item -Path $RegistryPath -Force | Out-Null New-Item -Path $RegistryPath -Force | Out-Null
} }
# Set the values based on the hashtable
foreach ($Name in $ExplorerProperties.Keys) { foreach ($Name in $ExplorerProperties.Keys) {
$Value = $ExplorerProperties[$Name] $Value = $ExplorerProperties[$Name]
New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType DWORD -Force | Out-Null New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -Type DWORD -Force | Out-Null
} }
} }
####################################################################################################################################
# Disable Group By Folder in Windows Explorer # Disable Group By Folder in Windows Explorer
Write-Host -ForegroundColor DarkGray ">>> Disabling Group By Folder feature <<<" Write-Host -ForegroundColor DarkGray ">>> Disabling Group By Folder feature <<<"
# Registry path for disabling automatic grouping
$groupByPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" $groupByPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
# Create the path if it doesn't exist # Create the path if it doesn't exist
if (-not (Test-Path $groupByPath)) { if (-not (Test-Path $groupByPath)) {
New-Item -Path $groupByPath -Force | Out-Null New-Item -Path $groupByPath -Force | Out-Null
} }
# Set the registry value to disable auto grouping # Set the registry value to disable auto grouping
Set-ItemProperty -Path $groupByPath -Name "UseAutoGrouping" -Value 0 -Type DWORD -Force | Out-Null Set-ItemProperty -Path $groupByPath -Name "UseAutoGrouping" -Value 0 -Type DWORD -Force | Out-Null
####################################################################################################################################
# Enable Dark Mode in Windows # Enable Dark Mode in Windows
Write-Host -ForegroundColor DarkGray ">>> Enable Dark Mode <<<" Write-Host -ForegroundColor DarkGray ">>> Enable Dark Mode <<<"
# Registry path for dark mode
$darkModePath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" $darkModePath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
# Create the path if it doesn't exist # Create the path if it doesn't exist
if (-not (Test-Path $darkModePath)) { if (-not (Test-Path $darkModePath)) {
New-Item -Path $darkModePath -Force | Out-Null New-Item -Path $darkModePath -Force | Out-Null
} }
# Set the registry values to enable dark mode # 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 "AppsUseLightTheme" -Value 0 -Type DWORD -Force | Out-Null
Set-ItemProperty -Path $darkModePath -Name "SystemUsesLightTheme" -Value 0 -Type DWORD -Force | Out-Null Set-ItemProperty -Path $darkModePath -Name "SystemUsesLightTheme" -Value 0 -Type DWORD -Force | Out-Null
Write-Host ""
########################################################################################## ##########################################################################################
# # # #
# Spotlight # # Spotlight #
# # # #
########################################################################################## ##########################################################################################
Write-Host ""
Write-Host -ForegroundColor Yellow ">>> Disable Spotlight <<<" Write-Host -ForegroundColor Yellow ">>> Disable Spotlight <<<"
Write-Host "" Write-Host ""
@@ -245,24 +262,42 @@ $RegistryPaths = @(
"HKLM:\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 # Disable Windows Spotlight on lockscreen
Write-Host -ForegroundColor DarkGray ">>> Disabling Windows Spotlight on lockscreen <<<" Write-Host -ForegroundColor DarkGray ">>> Disabling Windows Spotlight on lockscreen <<<"
foreach ($spotlight in $RegistryPaths[0..1]) { foreach ($spotlight in $RegistryPaths[0..1]) {
If (Test-Path $spotlight) { if (Test-Path $spotlight) {
Set-ItemProperty -Path $spotlight -Name "RotatingLockScreenOverlayEnabled" -Value 0 -Force | Out-Null foreach ($Name in $LockScreenProperties.Keys) {
Set-ItemProperty -Path $spotlight -Name "RotatingLockScreenEnabled" -Value 0 -Force | Out-Null $Value = $LockScreenProperties[$Name]
Set-ItemProperty -Path $spotlight -Name $Name -Value $Value -Force | Out-Null
}
} }
} }
# Disable Windows Spotlight on background # Disable Windows Spotlight on background
Write-Host -ForegroundColor DarkGray ">>> Disabling Windows Spotlight on background <<<" Write-Host -ForegroundColor DarkGray ">>> Disabling Windows Spotlight on background <<<"
foreach ($spotlight in $RegistryPaths[2..3]) { foreach ($spotlight in $RegistryPaths[2..3]) {
If (Test-Path $spotlight) { if (Test-Path $spotlight) {
Set-ItemProperty -Path $spotlight -Name "DisableSpotlightCollectionOnDesktop" -Value 1 -Force | Out-Null foreach ($Name in $BackgroundProperties.Keys) {
Set-ItemProperty -Path $spotlight -Name "DisableWindowsSpotlightFeatures" -Value 1 -Force | Out-Null $Value = $BackgroundProperties[$Name]
Set-ItemProperty -Path $spotlight -Name $Name -Value $Value -Force | Out-Null
}
} }
} }
Write-Host ""
########################################################################################## ##########################################################################################
# # # #
# Telemetry # # Telemetry #
@@ -270,98 +305,45 @@ foreach ($spotlight in $RegistryPaths[2..3]) {
########################################################################################## ##########################################################################################
# Configure Windows telemetry and activity tracking settings # Configure Windows telemetry and activity tracking settings
Write-Host -ForegroundColor DarkGray ">>> Configuring telemetry and activity settings <<<" Write-Host -ForegroundColor Yellow ">>> Disable some telemetry <<<"
# Define registry paths and values to modify $registryPaths = @(
$registryEntries = @( "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection",
@{ Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection"; Name = "AllowTelemetry"; Value = 0 }, "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced",
@{ Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; Name = "Start_TrackProgs"; Value = 0 }, "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System",
@{ Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System"; Name = "PublishUserActivities"; Value = 0 }, "HKCU:\SOFTWARE\Microsoft\Siuf\Rules"
@{ Path = "HKCU:\SOFTWARE\Microsoft\Siuf\Rules"; Name = "NumberOfSIUFInPeriod"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Siuf\Rules"; Name = "PeriodInNanoSeconds"; Value = -1 }
) )
# Loop through each registry entry and set the values $TelemetryProperties = @{
foreach ($entry in $registryEntries) { "AllowTelemetry" = 0
# Create the path if it doesn't exist "PublishUserActivities" = 0
if (-not (Test-Path $entry.Path)) {
New-Item -Path $entry.Path -Force | Out-Null
}
# Set the registry value
Set-ItemProperty -Path $entry.Path -Name $entry.Name -Value $entry.Value -Type DWORD -Force | Out-Null
} }
########################################################################################## $ActivityTrackingProperties = @{
# # "Start_TrackProgs" = 0
# Lock Screen Notifications # "NumberOfSIUFInPeriod" = 0
# # "PeriodInNanoSeconds" = -1
##########################################################################################
Write-Host ""
Write-Host -ForegroundColor Yellow ">>> Disable Notifications on Lock Screen <<<"
# 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
} }
# Iterate over each registry path # Disable telemetry settings
foreach ($RegistryPath in $RegistryPaths) { foreach ($path in $registryPaths[0..1]) {
# Create the key if it does not exist if (-not (Test-Path $path)) {
If (-NOT (Test-Path $RegistryPath)) { New-Item -Path $path -Force | Out-Null
New-Item -Path $RegistryPath -Force | Out-Null
} }
foreach ($Name in $TelemetryProperties.Keys) {
# Set the values based on the hashtable $Value = $TelemetryProperties[$Name]
foreach ($Name in $NotificationProperties.Keys) { Set-ItemProperty -Path $path -Name $Name -Value $Value -Type DWORD -Force | Out-Null
$Value = $NotificationProperties[$Name]
New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType DWORD -Force | Out-Null
} }
} }
Write-Host "" # Disable activity tracking settings
foreach ($path in $registryPaths[2..3]) {
########################################################################################## if (-not (Test-Path $path)) {
# # New-Item -Path $path -Force | Out-Null
# Control Panel #
# #
##########################################################################################
Write-Host -ForegroundColor Yellow ">>> Change Control Panel View <<<"
# Set the registry paths for both HKLM and HKCU
$RegistryPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel",
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel"
)
# Create a hashtable to store the property names and their corresponding values
$ControlPanelProperties = @{
"AllItemsIconView" = 1
"StartupPage" = 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 $ActivityTrackingProperties.Keys) {
# Set the values based on the hashtable $Value = $ActivityTrackingProperties[$Name]
foreach ($Name in $ControlPanelProperties.Keys) { Set-ItemProperty -Path $path -Name $Name -Value $Value -Type DWORD -Force | Out-Null
$Value = $ControlPanelProperties[$Name]
New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType DWORD -Force | Out-Null
} }
} }
@@ -373,8 +355,6 @@ Write-Host ""
# # # #
########################################################################################## ##########################################################################################
Write-Host -ForegroundColor Yellow ">>> Turn off Windows Welcome Experience <<<"
# Disable Windows notifications, suggestions, and ads # Disable Windows notifications, suggestions, and ads
Write-Host -ForegroundColor DarkGray ">>> Turn off Welcome Experience, notifications, suggestions, and ads in Windows <<<" Write-Host -ForegroundColor DarkGray ">>> Turn off Welcome Experience, notifications, suggestions, and ads in Windows <<<"
@@ -405,10 +385,127 @@ foreach ($entry in $registryEntries) {
New-Item -Path $entry.Path -Force | Out-Null New-Item -Path $entry.Path -Force | Out-Null
} }
# Set the registry value
Set-ItemProperty -Path $entry.Path -Name $entry.Name -Value $entry.Value -Type DWORD -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 <<<"
# 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 ""
##########################################################################################
# #
# Control Panel #
# #
##########################################################################################
Write-Host -ForegroundColor Yellow ">>> Change Control Panel View to 'Small icon'<<<"
$RegistryPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel",
"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel"
)
# 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 ""
########################################################################################## ##########################################################################################
# # # #
# Edge # # Edge #
@@ -456,48 +553,18 @@ $EdgeProperties = @{
# Iterate over each registry path # Iterate over each registry path
foreach ($RegistryPath in $RegistryPaths) { foreach ($RegistryPath in $RegistryPaths) {
# Create the key if it does not exist if (-NOT (Test-Path $RegistryPath)) {
If (-NOT (Test-Path $RegistryPath)) {
New-Item -Path $RegistryPath -Force | Out-Null New-Item -Path $RegistryPath -Force | Out-Null
} }
# Set the values based on the hashtable
foreach ($Name in $EdgeProperties.Keys) { foreach ($Name in $EdgeProperties.Keys) {
$Value = $EdgeProperties[$Name] $Value = $EdgeProperties[$Name]
New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType DWORD -Force | Out-Null New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -Type DWORD -Force | Out-Null
} }
} }
Write-Host "" Write-Host ""
##########################################################################################
# #
# Recall #
# #
##########################################################################################
#Write-Host -ForegroundColor Yellow ">>> Disable Recall <<<"
#
## Define registry paths for taskbar settings
#$RegistryPaths = @(
# "HKCU:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI",
# "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsAI"
#)
#
## 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 ""
########################################################################################## ##########################################################################################
# # # #
# Power Plan # # Power Plan #
@@ -506,11 +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 <<<" Write-Host -ForegroundColor DarkGray ">>> Activate High performance power plan <<<"
powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
# create ultimate powerscheme # Create ultimate powerscheme
powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61 | Out-Null 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
@@ -523,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
@@ -533,14 +606,26 @@ 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
####################################################################################################################################
# Disable Fast Startup # Disable Fast Startup
Write-Host -ForegroundColor DarkGray ">>> Disable fast startup <<<" Write-Host -ForegroundColor DarkGray ">>> Disable fast startup <<<"
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power" -Name "HiberbootEnabled" -Value "0" -Force | Out-Null $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 ""
########################################################################################## ##########################################################################################
@@ -550,8 +635,8 @@ Write-Host ""
########################################################################################## ##########################################################################################
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' <<<"
try { try {
@@ -560,7 +645,7 @@ 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)"
} }
#################################################################################################################################### ####################################################################################################################################
@@ -568,44 +653,21 @@ catch {
# 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
$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
#################################################################################################################################### ####################################################################################################################################
# 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
##########################################################################################
# #
# Available Updates #
# #
##########################################################################################
# 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 -Verbose -NoReboot
# Monitoring Update Installation
# Write-Host ""
# Get-WindowsUpdateLog
Write-Host "" Write-Host ""
########################################################################################## ##########################################################################################
@@ -620,47 +682,43 @@ Write-Host ""
# Get the directory of the currently executing script # Get the directory of the currently executing script
$scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Path $scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Path
# bloatware-apps.txt path # bloatware.txt path
$appsToRemove = Get-Content (Join-Path $scriptDirectory "bloatware-apps.txt") $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 {
winget uninstall --name $app -h | Out-Null winget uninstall --name $app | Out-Null
# Check if the app was removed successfully # Check if the app was removed successfully
if ($LASTEXITCODE -eq 0) { if ($LASTEXITCODE -eq 0) {
Write-Host "Removed: $app" 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: $_"
} }
} }
####################################################################################################################################
# Disable Microsoft 365 Ads in Settings Home # Disable Microsoft 365 Ads in Settings Home
Write-Host -ForegroundColor DarkGray ">>> Disabling Microsoft 365 Ads <<<" $RegistryPaths = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
# Registry path for disabling ads
$adsPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
# Create the path if it doesn't exist # Create the path if it doesn't exist
if (-not (Test-Path $adsPath)) { if (-not (Test-Path $RegistryPaths)) {
New-Item -Path $adsPath -Force | Out-Null New-Item -Path $RegistryPaths -Force | Out-Null
} }
# Set the registry value to disable ads # Set the registry value to disable ads
Set-ItemProperty -Path $adsPath -Name "DisableConsumerAccountStateContent" -Value 1 -Type DWORD -Force | Out-Null Set-ItemProperty -Path $RegistryPaths -Name "DisableConsumerAccountStateContent" -Value 1 -Type DWORD -Force | Out-Null
####################################################################################################################################
# Uninstall Microsoft Office # Uninstall Microsoft Office
Write-Host "" Write-Host ""
Write-Host -ForegroundColor Yellow ">>> Uninstallation of Microsoft Office <<<" 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"
# >>>>>> https://pureinfotech.com/windows-11-policy-remove-bloatware/ <<<<<<
#Write-Host -ForegroundColor Yellow ">>> From Windows 24H2, enable the policy "
#Write-Host ""
#Write-Host -ForegroundColor Magenta "Computer Configuration > Administrative Templates > Windows Components > App Package Deployment > 'Remove Default Microsoft Store packages from the system' "
#Write-Host ""
#Write-Host -ForegroundColor Yellow "to prevent bloatware from being installed for every user... <<<"
#Write-Host ""
########################################################################################## ##########################################################################################
# # # #
# SOFTWARE # # SOFTWARE #
@@ -677,26 +735,26 @@ Write-Host ""
Write-Host -ForegroundColor Yellow ">>> Install default SOFTWARE... <<<" Write-Host -ForegroundColor Yellow ">>> Install default SOFTWARE... <<<"
Write-Host "" Write-Host ""
winget install --disable-interactivity Microsoft.PowerShell SumatraPDF.SumatraPDF Oracle.JavaRuntimeEnvironment 7zip.7zip Microsoft.VCRedist.2010.x64 Mozilla.Firefox Notepad++.Notepad++ Flameshot.Flameshot --source winget 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
# NodirTemirkhodjaev.FortFirewall voidtools.Everything Flow-Launcher.Flow-Launcher AutoHotkey.AutoHotkey # 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 #Write-Host -ForegroundColor DarkGray ">>> Copy 'Supremo' to Public Desktop <<<"
# Define the path to the supremo executable ## Get the directory where the script is located
$supremo_path = Join-Path $scriptDirectory "supremo.exe" #$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."
#}
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 "" Write-Host ""
# Sleep for 30 seconds
Start-Sleep -Seconds 30
########################################################################################## ##########################################################################################
# # # #
# End # # End #