|
|
|
|
@@ -1,57 +1,71 @@
|
|
|
|
|
##########
|
|
|
|
|
# Win10 / WinServer2016 Initial Setup Script
|
|
|
|
|
# Author: Disassembler <disassembler@dasm.cz>
|
|
|
|
|
# Version: 2.6, 2017-07-31
|
|
|
|
|
# Version: v2.10, 2017-11-09
|
|
|
|
|
# Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
|
|
|
|
|
##########
|
|
|
|
|
|
|
|
|
|
# Default preset
|
|
|
|
|
$tweaks = @(
|
|
|
|
|
### Require administrator privileges ###
|
|
|
|
|
"RequireAdmin",
|
|
|
|
|
|
|
|
|
|
### Privacy Settings ###
|
|
|
|
|
"DisableTelemetry", # "EnableTelemetry",
|
|
|
|
|
"DisableWiFiSense", # "EnableWiFiSense",
|
|
|
|
|
# "DisableSmartScreen", # "EnableSmartScreen",
|
|
|
|
|
"DisableWebSearch", # "EnableWebSearch",
|
|
|
|
|
"DisableStartSuggestions", # "EnableStartSuggestions",
|
|
|
|
|
"DisableAppSuggestions", # "EnableAppSuggestions",
|
|
|
|
|
"DisableBackgroundApps", # "EnableBackgroundApps",
|
|
|
|
|
"DisableLockScreenSpotlight", # "EnableLockScreenSpotlight",
|
|
|
|
|
"DisableLocationTracking", # "EnableLocationTracking",
|
|
|
|
|
"DisableMapUpdates", # "EnableMapUpdates",
|
|
|
|
|
"DisableFeedback", # "EnableFeedback",
|
|
|
|
|
"DisableAdvertisingID", # "EnableAdvertisingID",
|
|
|
|
|
"DisableCortana", # "EnableCortana",
|
|
|
|
|
"DisableErrorReporting", # "EnableErrorReporting",
|
|
|
|
|
"RestrictUpdateP2P", # "UnrestrictUpdateP2P",
|
|
|
|
|
"SetP2PUpdateLocal", # "SetP2PUpdateInternet",
|
|
|
|
|
"DisableAutoLogger", # "EnableAutoLogger",
|
|
|
|
|
"DisableDiagTrack", # "EnableDiagTrack",
|
|
|
|
|
"DisableWAPPush", # "EnableWAPPush",
|
|
|
|
|
|
|
|
|
|
### Service Tweaks ###
|
|
|
|
|
# "LowerUAC", # "RaiseUAC",
|
|
|
|
|
# "SetUACLow", # "SetUACHigh",
|
|
|
|
|
# "EnableSharingMappedDrives", # "DisableSharingMappedDrives",
|
|
|
|
|
"DisableAdminShares", # "EnableAdminShares",
|
|
|
|
|
"DisableSMB1", # "EnableSMB1",
|
|
|
|
|
# "DisableSMB1", # "EnableSMB1",
|
|
|
|
|
"SetCurrentNetworkPrivate", # "SetCurrentNetworkPublic",
|
|
|
|
|
# "SetUnknownNetworksPrivate", # "SetUnknownNetworksPublic",
|
|
|
|
|
"EnableCtrldFolderAccess", # "DisableCtrldFolderAccess",
|
|
|
|
|
# "DisableFirewall", # "EnableFirewall",
|
|
|
|
|
# "DisableDefender", # "EnableDefender",
|
|
|
|
|
# "DisableUpdateMSRT", # "EnableUpdateMSRT",
|
|
|
|
|
# "DisableUpdateDriver", # "EnableUpdateDriver",
|
|
|
|
|
"DisableUpdateRestart", # "EnableUpdateRestart",
|
|
|
|
|
"DisableHomeGroups", # "EnableHomeGroups",
|
|
|
|
|
"DisableSharedExperiences", # "EnableSharedExperiences",
|
|
|
|
|
"DisableRemoteAssistance", # "EnableRemoteAssistance",
|
|
|
|
|
"EnableRemoteDesktop", # "DisableRemoteDesktop",
|
|
|
|
|
"DisableAutoplay", # "EnableAutoplay",
|
|
|
|
|
"DisableAutorun", # "EnableAutorun",
|
|
|
|
|
# "EnableStorageSense", # "DisableStorageSense",
|
|
|
|
|
# "DisableDefragmentation", # "EnableDefragmentation",
|
|
|
|
|
# "DisableSuperfetch", # "EnableSuperfetch",
|
|
|
|
|
# "DisableIndexing", # "EnableIndexing",
|
|
|
|
|
# "SetBIOSTimeUTC", # "SetBIOSTimeLocal",
|
|
|
|
|
# "EnableHibernation", # "DisableHibernation",
|
|
|
|
|
# "DisableFastStartup", # "EnableFastStartup",
|
|
|
|
|
|
|
|
|
|
### UI Tweaks ###
|
|
|
|
|
"DisableActionCenter", # "EnableActionCenter",
|
|
|
|
|
"DisableLockScreen", # "EnableLockScreen",
|
|
|
|
|
# "DisableLockScreenRS1", # "EnableLockScreenRS1",
|
|
|
|
|
"HideNetworkFromLockScreen", # "ShowNetworkOnLockScreen",
|
|
|
|
|
"HideShutdownFromLockScreen", # "ShowShutdownOnLockScreen",
|
|
|
|
|
"DisableStickyKeys", # "EnableStickyKeys",
|
|
|
|
|
"ShowTaskManagerDetails" # "HideTaskManagerDetails",
|
|
|
|
|
"ShowFileOperationsDetails", # "HideFileOperationsDetails",
|
|
|
|
|
# "EnableFileDeleteConfirm", # "DisableFileDeleteConfirm",
|
|
|
|
|
"HideTaskbarSearchBox", # "ShowTaskbarSearchBox",
|
|
|
|
|
"HideTaskView", # "ShowTaskView",
|
|
|
|
|
"ShowSmallTaskbarIcons", # "ShowLargeTaskbarIcons",
|
|
|
|
|
@@ -62,14 +76,19 @@ $tweaks = @(
|
|
|
|
|
"ShowHiddenFiles", # "HideHiddenFiles",
|
|
|
|
|
"HideSyncNotifications" # "ShowSyncNotifications",
|
|
|
|
|
"HideRecentShortcuts", # "ShowRecentShortcuts",
|
|
|
|
|
"ExplorerThisPC", # "ExplorerQuickAccess",
|
|
|
|
|
"SetExplorerThisPC", # "SetExplorerQuickAccess",
|
|
|
|
|
"ShowThisPCOnDesktop", # "HideThisPCFromDesktop",
|
|
|
|
|
# "ShowUserFolderOnDesktop", # "HideUserFolderFromDesktop",
|
|
|
|
|
"HideDesktopFromThisPC", # "ShowDesktopInThisPC",
|
|
|
|
|
"HideDocumentsFromThisPC", # "ShowDocumentsInThisPC",
|
|
|
|
|
"HideDownloadsFromThisPC", # "ShowDownloadsInThisPC",
|
|
|
|
|
"HideMusicFromThisPC", # "ShowMusicInThisPC",
|
|
|
|
|
"HidePicturesFromThisPC", # "ShowPicturesInThisPC",
|
|
|
|
|
"HideVideosFromThisPC", # "ShowVideosInThisPC",
|
|
|
|
|
"Hide3DObjectsFromThisPC", # "Show3DObjectsInThisPC",
|
|
|
|
|
"SetVisualFXPerformance", # "SetVisualFXAppearance",
|
|
|
|
|
# "DisableThumbnails", # "EnableThumbnails",
|
|
|
|
|
"DisableThumbsDB", # "EnableThumbsDB",
|
|
|
|
|
# "AddENKeyboard", # "RemoveENKeyboard",
|
|
|
|
|
# "EnableNumlock", # "DisableNumlock",
|
|
|
|
|
|
|
|
|
|
@@ -79,8 +98,8 @@ $tweaks = @(
|
|
|
|
|
"UninstallMsftBloat", # "InstallMsftBloat",
|
|
|
|
|
"UninstallThirdPartyBloat", # "InstallThirdPartyBloat",
|
|
|
|
|
# "UninstallWindowsStore", # "InstallWindowsStore",
|
|
|
|
|
"DisableConsumerApps", # "EnableConsumerApps",
|
|
|
|
|
"DisableXboxFeatures", # "EnableXboxFeatures",
|
|
|
|
|
"DisableAdobeFlash", # "EnableAdobeFlash",
|
|
|
|
|
# "UninstallMediaPlayer", # "InstallMediaPlayer",
|
|
|
|
|
# "UninstallWorkFolders", # "InstallWorkFolders",
|
|
|
|
|
# "InstallLinuxSubsystem", # "UninstallLinuxSubsystem",
|
|
|
|
|
@@ -90,7 +109,7 @@ $tweaks = @(
|
|
|
|
|
"DisableSearchAppInStore", # "EnableSearchAppInStore",
|
|
|
|
|
"DisableNewAppPrompt", # "EnableNewAppPrompt",
|
|
|
|
|
"EnableF8BootMenu", # "DisableF8BootMenu",
|
|
|
|
|
# "SetDEPOptOut", # "SetDEPOptIn",
|
|
|
|
|
"SetDEPOptOut", # "SetDEPOptIn",
|
|
|
|
|
|
|
|
|
|
### Server Specific Tweaks ###
|
|
|
|
|
# "HideServerManagerOnLogin", # "ShowServerManagerOnLogin",
|
|
|
|
|
@@ -139,6 +158,9 @@ Function DisableWiFiSense {
|
|
|
|
|
# Enable Wi-Fi Sense
|
|
|
|
|
Function EnableWiFiSense {
|
|
|
|
|
Write-Host "Enabling Wi-Fi Sense..."
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Force | Out-Null
|
|
|
|
|
}
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 1
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
@@ -183,18 +205,63 @@ Function EnableWebSearch {
|
|
|
|
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "DisableWebSearch" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable Start Menu suggestions
|
|
|
|
|
Function DisableStartSuggestions {
|
|
|
|
|
Write-Host "Disabling Start Menu suggestions..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 0
|
|
|
|
|
# Disable Application suggestions and automatic installation
|
|
|
|
|
Function DisableAppSuggestions {
|
|
|
|
|
Write-Host "Disabling Application suggestions..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "ContentDeliveryAllowed" -Type DWord -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "OemPreInstalledAppsEnabled" -Type DWord -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEnabled" -Type DWord -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEverEnabled" -Type DWord -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SilentInstalledAppsEnabled" -Type DWord -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338389Enabled" -Type DWord -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338388Enabled" -Type DWord -Value 0
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force | Out-Null
|
|
|
|
|
}
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable Start Menu suggestions
|
|
|
|
|
Function EnableStartSuggestions {
|
|
|
|
|
Write-Host "Enabling Start Menu suggestions..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 1
|
|
|
|
|
# Enable Application suggestions and automatic installation
|
|
|
|
|
Function EnableAppSuggestions {
|
|
|
|
|
Write-Host "Enabling Application suggestions..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "ContentDeliveryAllowed" -Type DWord -Value 1
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "OemPreInstalledAppsEnabled" -Type DWord -Value 1
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEnabled" -Type DWord -Value 1
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEverEnabled" -Type DWord -Value 1
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SilentInstalledAppsEnabled" -Type DWord -Value 1
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338389Enabled" -Type DWord -Value 1
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 1
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338388Enabled" -ErrorAction SilentlyContinue
|
|
|
|
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable Background application access - Ie. if apps can download or update even when they aren't used
|
|
|
|
|
Function DisableBackgroundApps {
|
|
|
|
|
Write-Host "Disabling Background application access..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Name "GlobalUserDisabled" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable Background application access
|
|
|
|
|
Function EnableBackgroundApps {
|
|
|
|
|
Write-Host "Enabling Background application access..."
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Name "GlobalUserDisabled" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable Lock screen Spotlight - New backgrounds, tips, advertisements etc.
|
|
|
|
|
Function DisableLockScreenSpotlight {
|
|
|
|
|
Write-Host "Disabling Lock screen spotlight..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "RotatingLockScreenEnabled" -Type DWord -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "RotatingLockScreenOverlayEnabled" -Type DWord -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338387Enabled" -Type DWord -Value 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable Lock screen Spotlight
|
|
|
|
|
Function EnableLockScreenSpotlight {
|
|
|
|
|
Write-Host "Disabling Lock screen spotlight..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "RotatingLockScreenEnabled" -Type DWord -Value 1
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "RotatingLockScreenOverlayEnabled" -Type DWord -Value 1
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338387Enabled" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable Location Tracking
|
|
|
|
|
@@ -211,6 +278,18 @@ Function EnableLocationTracking {
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable automatic Maps updates
|
|
|
|
|
Function DisableMapUpdates {
|
|
|
|
|
Write-Host "Disabling automatic Maps updates..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -Type DWord -Value 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable automatic Maps updates
|
|
|
|
|
Function EnableMapUpdates {
|
|
|
|
|
Write-Host "Enable automatic Maps updates..."
|
|
|
|
|
Remove-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable Feedback
|
|
|
|
|
Function DisableFeedback {
|
|
|
|
|
Write-Host "Disabling Feedback..."
|
|
|
|
|
@@ -233,12 +312,17 @@ Function DisableAdvertisingID {
|
|
|
|
|
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" -Type DWord -Value 0
|
|
|
|
|
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy")) {
|
|
|
|
|
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy" -Name "TailoredExperiencesWithDiagnosticDataEnabled" -Type DWord -Value 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable Advertising ID
|
|
|
|
|
Function EnableAdvertisingID {
|
|
|
|
|
Write-Host "Enabling Advertising ID..."
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" -ErrorAction SilentlyContinue
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy" -Name "TailoredExperiencesWithDiagnosticDataEnabled" -Type DWord -Value 2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable Cortana
|
|
|
|
|
@@ -267,6 +351,9 @@ Function DisableCortana {
|
|
|
|
|
Function EnableCortana {
|
|
|
|
|
Write-Host "Enabling Cortana..."
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -ErrorAction SilentlyContinue
|
|
|
|
|
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) {
|
|
|
|
|
New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null
|
|
|
|
|
}
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 0
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -ErrorAction SilentlyContinue
|
|
|
|
|
@@ -286,7 +373,7 @@ Function EnableErrorReporting {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Restrict Windows Update P2P only to local network
|
|
|
|
|
Function RestrictUpdateP2P {
|
|
|
|
|
Function SetP2PUpdateLocal {
|
|
|
|
|
Write-Host "Restricting Windows Update P2P only to local network..."
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" | Out-Null
|
|
|
|
|
@@ -299,7 +386,7 @@ Function RestrictUpdateP2P {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Unrestrict Windows Update P2P
|
|
|
|
|
Function UnrestrictUpdateP2P {
|
|
|
|
|
Function SetP2PUpdateInternet {
|
|
|
|
|
Write-Host "Unrestricting Windows Update P2P to internet..."
|
|
|
|
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -ErrorAction SilentlyContinue
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode" -ErrorAction SilentlyContinue
|
|
|
|
|
@@ -357,15 +444,15 @@ Function EnableWAPPush {
|
|
|
|
|
# Service Tweaks
|
|
|
|
|
##########
|
|
|
|
|
|
|
|
|
|
# Lower UAC level
|
|
|
|
|
Function LowerUAC {
|
|
|
|
|
# Lower UAC level (disabling it completely would break apps)
|
|
|
|
|
Function SetUACLow {
|
|
|
|
|
Write-Host "Lowering UAC level..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Raise UAC level
|
|
|
|
|
Function RaiseUAC {
|
|
|
|
|
Function SetUACHigh {
|
|
|
|
|
Write-Host "Raising UAC level..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 5
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 1
|
|
|
|
|
@@ -395,13 +482,13 @@ Function EnableAdminShares {
|
|
|
|
|
Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareWks" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable obsolete SMB 1.0 protocol
|
|
|
|
|
# Disable obsolete SMB 1.0 protocol - Disabled by default since 1709
|
|
|
|
|
Function DisableSMB1 {
|
|
|
|
|
Write-Host "Disabling SMB 1.0 protocol..."
|
|
|
|
|
Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable obsolete SMB 1.0 protocol
|
|
|
|
|
# Enable obsolete SMB 1.0 protocol - Disabled by default since 1709
|
|
|
|
|
Function EnableSMB1 {
|
|
|
|
|
Write-Host "Enabling SMB 1.0 protocol..."
|
|
|
|
|
Set-SmbServerConfiguration -EnableSMB1Protocol $true -Force
|
|
|
|
|
@@ -434,6 +521,18 @@ Function SetUnknownNetworksPublic {
|
|
|
|
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\010103000F0000F0010000000F0000F0C967A3643C3AD745950DA7859209176EF5B87C875FA20DF21951640E807D7C24" -Name "Category" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable Controlled Folder Access (Defender Exploit Guard feature) - Not applicable to Server
|
|
|
|
|
Function EnableCtrldFolderAccess {
|
|
|
|
|
Write-Host "Enabling Controlled Folder Access..."
|
|
|
|
|
Set-MpPreference -EnableControlledFolderAccess Enabled
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable Controlled Folder Access (Defender Exploit Guard feature) - Not applicable to Server
|
|
|
|
|
Function DisableCtrldFolderAccess {
|
|
|
|
|
Write-Host "Disabling Controlled Folder Access..."
|
|
|
|
|
Set-MpPreference -EnableControlledFolderAccess Disabled
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable Firewall
|
|
|
|
|
Function DisableFirewall {
|
|
|
|
|
Write-Host "Disabling Firewall..."
|
|
|
|
|
@@ -501,18 +600,18 @@ Function EnableUpdateDriver {
|
|
|
|
|
# Disable Windows Update automatic restart
|
|
|
|
|
Function DisableUpdateRestart {
|
|
|
|
|
Write-Host "Disabling Windows Update automatic restart..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 1
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
|
|
|
|
|
}
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -Type DWord -Value 1
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -Type DWord -Value 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable Windows Update automatic restart
|
|
|
|
|
Function EnableUpdateRestart {
|
|
|
|
|
Write-Host "Enabling Windows Update automatic restart..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 0
|
|
|
|
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -ErrorAction SilentlyContinue
|
|
|
|
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Stop and disable Home Groups services - Not applicable to Server
|
|
|
|
|
@@ -532,6 +631,18 @@ Function EnableHomeGroups {
|
|
|
|
|
Start-Service "HomeGroupProvider" -WarningAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable Shared Experiences - Not applicable to Server
|
|
|
|
|
Function DisableSharedExperiences {
|
|
|
|
|
Write-Host "Disabling Shared Experiences..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CDP" -Name "RomeSdkChannelUserAuthzPolicy" -Type DWord -Value 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable Shared Experiences - Not applicable to Server
|
|
|
|
|
Function EnableSharedExperiences {
|
|
|
|
|
Write-Host "Enabling Shared Experiences..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CDP" -Name "RomeSdkChannelUserAuthzPolicy" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable Remote Assistance - Not applicable to Server (unless Remote Assistance is explicitly installed)
|
|
|
|
|
Function DisableRemoteAssistance {
|
|
|
|
|
Write-Host "Disabling Remote Assistance..."
|
|
|
|
|
@@ -585,6 +696,18 @@ Function EnableAutorun {
|
|
|
|
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoDriveTypeAutoRun" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable Storage Sense - automatic disk cleanup - Not applicable to Server
|
|
|
|
|
Function EnableStorageSense {
|
|
|
|
|
Write-Host "Enabling Storage Sense..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" -Name "01" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable Storage Sense - Not applicable to Server
|
|
|
|
|
Function DisableStorageSense {
|
|
|
|
|
Write-Host "Disabling Storage Sense..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" -Name "01" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable scheduled defragmentation task
|
|
|
|
|
Function DisableDefragmentation {
|
|
|
|
|
Write-Host "Disabling scheduled defragmentation..."
|
|
|
|
|
@@ -638,6 +761,38 @@ Function SetBIOSTimeLocal {
|
|
|
|
|
Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" -Name "RealTimeIsUniversal" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable Hibernation - Do not use on Server with automatically started Hyper-V hvboot service as it may lead to BSODs (Win10 with Hyper-V is fine)
|
|
|
|
|
Function EnableHibernation {
|
|
|
|
|
Write-Host "Enabling Hibernation..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Session Manager\Power" -Name "HibernteEnabled" -Type Dword -Value 1
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" -Name "ShowHibernateOption" -Type Dword -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable Hibernation
|
|
|
|
|
Function DisableHibernation {
|
|
|
|
|
Write-Host "Disabling Hibernation..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Session Manager\Power" -Name "HibernteEnabled" -Type Dword -Value 0
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" -Name "ShowHibernateOption" -Type Dword -Value 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable Fast Startup
|
|
|
|
|
Function DisableFastStartup {
|
|
|
|
|
Write-Host "Disabling Fast Startup..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power" -Name "HiberbootEnabled" -Type DWord -Value 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable Fast Startup
|
|
|
|
|
Function EnableFastStartup {
|
|
|
|
|
Write-Host "Enabling Fast Startup..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power" -Name "HiberbootEnabled" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
##########
|
|
|
|
|
@@ -676,7 +831,7 @@ Function EnableLockScreen {
|
|
|
|
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable Lock screen (Anniversary Update workaround) - Applicable to RS1 or newer
|
|
|
|
|
# Disable Lock screen (Anniversary Update workaround) - Applicable to 1607 or newer
|
|
|
|
|
Function DisableLockScreenRS1 {
|
|
|
|
|
Write-Host "Disabling Lock screen using scheduler workaround..."
|
|
|
|
|
$service = New-Object -com Schedule.Service
|
|
|
|
|
@@ -692,12 +847,36 @@ Function DisableLockScreenRS1 {
|
|
|
|
|
$service.GetFolder("\").RegisterTaskDefinition("Disable LockScreen", $task, 6, "NT AUTHORITY\SYSTEM", $null, 4) | Out-Null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable Lock screen (Anniversary Update workaround) - Applicable to RS1 or newer
|
|
|
|
|
# Enable Lock screen (Anniversary Update workaround) - Applicable to 1607 or newer
|
|
|
|
|
Function EnableLockScreenRS1 {
|
|
|
|
|
Write-Host "Enabling Lock screen (removing scheduler workaround)..."
|
|
|
|
|
Unregister-ScheduledTask -TaskName "Disable LockScreen" -Confirm:$false -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Hide network options from Lock Screen
|
|
|
|
|
Function HideNetworkFromLockScreen {
|
|
|
|
|
Write-Host "Hiding network options from Lock Screen..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "DontDisplayNetworkSelectionUI" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Show network options on lock screen
|
|
|
|
|
Function ShowNetworkOnLockScreen {
|
|
|
|
|
Write-Host "Showing network options on Lock Screen..."
|
|
|
|
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "DontDisplayNetworkSelectionUI" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Hide shutdown options from Lock Screen
|
|
|
|
|
Function HideShutdownFromLockScreen {
|
|
|
|
|
Write-Host "Hiding shutdown options from Lock Screen..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ShutdownWithoutLogon" -Type DWord -Value 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Show shutdown options on lock screen
|
|
|
|
|
Function ShowShutdownOnLockScreen {
|
|
|
|
|
Write-Host "Showing shutdown options on Lock Screen..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ShutdownWithoutLogon" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable Sticky keys prompt
|
|
|
|
|
Function DisableStickyKeys {
|
|
|
|
|
Write-Host "Disabling Sticky keys prompt..."
|
|
|
|
|
@@ -754,6 +933,21 @@ Function HideFileOperationsDetails {
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Name "EnthusiastMode" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable file delete confirmation dialog
|
|
|
|
|
Function EnableFileDeleteConfirm {
|
|
|
|
|
Write-Host "Enabling file delete confirmation dialog..."
|
|
|
|
|
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) {
|
|
|
|
|
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "ConfirmFileDelete" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable file delete confirmation dialog
|
|
|
|
|
Function DisableFileDeleteConfirm {
|
|
|
|
|
Write-Host "Disabling file delete confirmation dialog..."
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "ConfirmFileDelete" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Hide Taskbar Search button / box
|
|
|
|
|
Function HideTaskbarSearchBox {
|
|
|
|
|
Write-Host "Hiding Taskbar Search box / button..."
|
|
|
|
|
@@ -880,13 +1074,13 @@ Function ShowRecentShortcuts {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Change default Explorer view to This PC
|
|
|
|
|
Function ExplorerThisPC {
|
|
|
|
|
Function SetExplorerThisPC {
|
|
|
|
|
Write-Host "Changing default Explorer view to This PC..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Change default Explorer view to Quick Access
|
|
|
|
|
Function ExplorerQuickAccess {
|
|
|
|
|
Function SetExplorerQuickAccess {
|
|
|
|
|
Write-Host "Changing default Explorer view to Quick Access..."
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
@@ -911,88 +1105,198 @@ Function HideThisPCFromDesktop {
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Show User Folder shortcut on desktop
|
|
|
|
|
Function ShowUserFolderOnDesktop {
|
|
|
|
|
Write-Host "Showing User Folder shortcut on desktop..."
|
|
|
|
|
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu")) {
|
|
|
|
|
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Force | Out-Null
|
|
|
|
|
}
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{59031a47-3f72-44a7-89c5-5595fe6b30ee}" -Type DWord -Value 0
|
|
|
|
|
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel")) {
|
|
|
|
|
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Force | Out-Null
|
|
|
|
|
}
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{59031a47-3f72-44a7-89c5-5595fe6b30ee}" -Type DWord -Value 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Hide User Folder shortcut from desktop
|
|
|
|
|
Function HideUserFolderFromDesktop {
|
|
|
|
|
Write-Host "Hiding User Folder shortcut from desktop..."
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{59031a47-3f72-44a7-89c5-5595fe6b30ee}" -ErrorAction SilentlyContinue
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{59031a47-3f72-44a7-89c5-5595fe6b30ee}" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Hide Desktop icon from This PC
|
|
|
|
|
Function HideDesktopFromThisPC {
|
|
|
|
|
Write-Host "Hiding Desktop icon from This PC..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
|
|
|
|
|
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}" -Recurse -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Show Desktop icon in This PC
|
|
|
|
|
Function ShowDesktopInThisPC {
|
|
|
|
|
Write-Host "Showing Desktop icon in This PC..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Hide Documents icon from This PC
|
|
|
|
|
Function HideDocumentsFromThisPC {
|
|
|
|
|
Write-Host "Hiding Documents icon from This PC..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
|
|
|
|
|
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}" -Recurse -ErrorAction SilentlyContinue
|
|
|
|
|
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}" -Recurse -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Show Documents icon in This PC
|
|
|
|
|
Function ShowDocumentsInThisPC {
|
|
|
|
|
Write-Host "Showing Documents icon in This PC..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Hide Downloads icon from This PC
|
|
|
|
|
Function HideDownloadsFromThisPC {
|
|
|
|
|
Write-Host "Hiding Downloads icon from This PC..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
|
|
|
|
|
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}" -Recurse -ErrorAction SilentlyContinue
|
|
|
|
|
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}" -Recurse -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Show Downloads icon in This PC
|
|
|
|
|
Function ShowDownloadsInThisPC {
|
|
|
|
|
Write-Host "Showing Downloads icon in This PC..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Hide Music icon from This PC
|
|
|
|
|
Function HideMusicFromThisPC {
|
|
|
|
|
Write-Host "Hiding Music icon from This PC..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
|
|
|
|
|
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" -Recurse -ErrorAction SilentlyContinue
|
|
|
|
|
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}" -Recurse -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Show Music icon in This PC
|
|
|
|
|
Function ShowMusicInThisPC {
|
|
|
|
|
Write-Host "Showing Music icon in This PC..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Hide Pictures icon from This PC
|
|
|
|
|
Function HidePicturesFromThisPC {
|
|
|
|
|
Write-Host "Hiding Pictures icon from This PC..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
|
|
|
|
|
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}" -Recurse -ErrorAction SilentlyContinue
|
|
|
|
|
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}" -Recurse -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Show Pictures icon in This PC
|
|
|
|
|
Function ShowPicturesInThisPC {
|
|
|
|
|
Write-Host "Showing Pictures icon in This PC..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Hide Videos icon from This PC
|
|
|
|
|
Function HideVideosFromThisPC {
|
|
|
|
|
Write-Host "Hiding Videos icon from This PC..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
|
|
|
|
|
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" -Recurse -ErrorAction SilentlyContinue
|
|
|
|
|
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" -Recurse -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Show Videos icon in This PC
|
|
|
|
|
Function ShowVideosInThisPC {
|
|
|
|
|
Write-Host "Showing Videos icon in This PC..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Hide 3D Objects icon from This PC
|
|
|
|
|
Function Hide3DObjectsFromThisPC {
|
|
|
|
|
Write-Host "Hiding 3D Objects icon from This PC..."
|
|
|
|
|
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" -Recurse -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Show 3D Objects icon in This PC
|
|
|
|
|
Function Show3DObjectsInThisPC {
|
|
|
|
|
Write-Host "Showing 3D Objects icon in This PC..."
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" | Out-Null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Adjusts visual effects for performance - Disables animations, transparency etc. but leaves font smoothing and miniatures enabled
|
|
|
|
|
Function SetVisualFXPerformance {
|
|
|
|
|
Write-Host "Adjusting visual effects for performance..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "DragFullWindows" -Type String -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "MenuShowDelay" -Type String -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask" -Type Binary -Value ([byte[]](0x90,0x12,0x03,0x80,0x10,0x00,0x00,0x00))
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop\WindowMetrics" -Name "MinAnimate" -Type String -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name "KeyboardDelay" -Type DWord -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewAlphaSelect" -Type DWord -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewShadow" -Type DWord -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAnimations" -Type DWord -Value 0
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" -Name "VisualFXSetting" -Type DWord -Value 3
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "EnableAeroPeek" -Type DWord -Value 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Adjusts visual effects for appearance
|
|
|
|
|
Function SetVisualFXAppearance {
|
|
|
|
|
Write-Host "Adjusting visual effects for appearance..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "DragFullWindows" -Type String -Value 1
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "MenuShowDelay" -Type String -Value 400
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask" -Type Binary -Value ([byte[]](0x9E,0x1E,0x07,0x80,0x12,0x00,0x00,0x00))
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop\WindowMetrics" -Name "MinAnimate" -Type String -Value 1
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name "KeyboardDelay" -Type DWord -Value 1
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewAlphaSelect" -Type DWord -Value 1
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewShadow" -Type DWord -Value 1
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAnimations" -Type DWord -Value 1
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" -Name "VisualFXSetting" -Type DWord -Value 3
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "EnableAeroPeek" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable thumbnails, show only file extension icons
|
|
|
|
|
Function DisableThumbnails {
|
|
|
|
|
Write-Host "Disabling thumbnails..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "IconsOnly" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable thumbnails
|
|
|
|
|
Function EnableThumbnails {
|
|
|
|
|
Write-Host "Enabling thumbnails..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "IconsOnly" -Type DWord -Value 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable creation of Thumbs.db thumbnail cache files
|
|
|
|
|
Function DisableThumbsDB {
|
|
|
|
|
Write-Host "Disabling creation of Thumbs.db..."
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "DisableThumbnailCache" -Type DWord -Value 1
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "DisableThumbsDBOnNetworkFolders" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable creation of Thumbs.db thumbnail cache files
|
|
|
|
|
Function EnableThumbsDB {
|
|
|
|
|
Write-Host "Enable creation of Thumbs.db..."
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "DisableThumbnailCache" -ErrorAction SilentlyContinue
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "DisableThumbsDBOnNetworkFolders" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Add secondary en-US keyboard
|
|
|
|
|
@@ -1130,6 +1434,7 @@ Function UninstallMsftBloat {
|
|
|
|
|
Get-AppxPackage "Microsoft.MSPaint" | Remove-AppxPackage
|
|
|
|
|
Get-AppxPackage "Microsoft.Microsoft3DViewer" | Remove-AppxPackage
|
|
|
|
|
Get-AppxPackage "Microsoft.RemoteDesktop" | Remove-AppxPackage
|
|
|
|
|
Get-AppxPackage "Microsoft.Print3D" | Remove-AppxPackage
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Install default Microsoft applications
|
|
|
|
|
@@ -1169,6 +1474,7 @@ Function InstallMsftBloat {
|
|
|
|
|
Get-AppxPackage -AllUsers "Microsoft.MSPaint" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
Get-AppxPackage -AllUsers "Microsoft.Microsoft3DViewer" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
Get-AppxPackage -AllUsers "Microsoft.RemoteDesktop" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
Get-AppxPackage -AllUsers "Microsoft.Print3D" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
}
|
|
|
|
|
# In case you have removed them for good, you can try to restore the files using installation medium as follows
|
|
|
|
|
# New-Item C:\Mnt -Type Directory | Out-Null
|
|
|
|
|
@@ -1179,7 +1485,7 @@ Function InstallMsftBloat {
|
|
|
|
|
|
|
|
|
|
# Uninstall default third party applications
|
|
|
|
|
function UninstallThirdPartyBloat {
|
|
|
|
|
|
|
|
|
|
Write-Host "Uninstalling default third party applications..."
|
|
|
|
|
Get-AppxPackage "9E2F88E3.Twitter" | Remove-AppxPackage
|
|
|
|
|
Get-AppxPackage "king.com.CandyCrushSodaSaga" | Remove-AppxPackage
|
|
|
|
|
Get-AppxPackage "4DF9E0F8.Netflix" | Remove-AppxPackage
|
|
|
|
|
@@ -1193,10 +1499,15 @@ function UninstallThirdPartyBloat {
|
|
|
|
|
Get-AppxPackage "Facebook.Facebook" | Remove-AppxPackage
|
|
|
|
|
Get-AppxPackage "46928bounde.EclipseManager" | Remove-AppxPackage
|
|
|
|
|
Get-AppxPackage "A278AB0D.MarchofEmpires" | Remove-AppxPackage
|
|
|
|
|
Get-AppxPackage "KeeperSecurityInc.Keeper" | Remove-AppxPackage
|
|
|
|
|
Get-AppxPackage "king.com.BubbleWitch3Saga" | Remove-AppxPackage
|
|
|
|
|
Get-AppxPackage "89006A2E.AutodeskSketchBook" | Remove-AppxPackage
|
|
|
|
|
Get-AppxPackage "CAF9E577.Plex" | Remove-AppxPackage
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Install default third party applications
|
|
|
|
|
Function InstallThirdPartyBloat {
|
|
|
|
|
Write-Host "Installing default third party applications..."
|
|
|
|
|
Get-AppxPackage -AllUsers "9E2F88E3.Twitter" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
Get-AppxPackage -AllUsers "king.com.CandyCrushSodaSaga" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
Get-AppxPackage -AllUsers "4DF9E0F8.Netflix" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
@@ -1210,6 +1521,10 @@ Function InstallThirdPartyBloat {
|
|
|
|
|
Get-AppxPackage -AllUsers "Facebook.Facebook" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
Get-AppxPackage -AllUsers "46928bounde.EclipseManager" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
Get-AppxPackage -AllUsers "A278AB0D.MarchofEmpires" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
Get-AppxPackage -AllUsers "KeeperSecurityInc.Keeper" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
Get-AppxPackage -AllUsers "king.com.BubbleWitch3Saga" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
Get-AppxPackage -AllUsers "89006A2E.AutodeskSketchBook" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
Get-AppxPackage -AllUsers "CAF9E577.Plex" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Uninstall Windows Store
|
|
|
|
|
@@ -1226,21 +1541,6 @@ Function InstallWindowsStore {
|
|
|
|
|
Get-AppxPackage -AllUsers "Microsoft.WindowsStore" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable installation of consumer experience applications
|
|
|
|
|
Function DisableConsumerApps {
|
|
|
|
|
Write-Host "Disabling installation of consumer experience applications..."
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force | Out-Null
|
|
|
|
|
}
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable installation of consumer experience applications
|
|
|
|
|
Function EnableConsumerApps {
|
|
|
|
|
Write-Host "Enabling installation of consumer experience applications..."
|
|
|
|
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable Xbox features
|
|
|
|
|
Function DisableXboxFeatures {
|
|
|
|
|
Write-Host "Disabling Xbox features..."
|
|
|
|
|
@@ -1248,6 +1548,7 @@ Function DisableXboxFeatures {
|
|
|
|
|
Get-AppxPackage "Microsoft.XboxIdentityProvider" | Remove-AppxPackage
|
|
|
|
|
Get-AppxPackage "Microsoft.XboxSpeechToTextOverlay" | Remove-AppxPackage
|
|
|
|
|
Get-AppxPackage "Microsoft.XboxGameOverlay" | Remove-AppxPackage
|
|
|
|
|
Get-AppxPackage "Microsoft.Xbox.TCUI" | Remove-AppxPackage
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_Enabled" -Type DWord -Value 0
|
|
|
|
|
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR")) {
|
|
|
|
|
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" | Out-Null
|
|
|
|
|
@@ -1262,10 +1563,31 @@ Function EnableXboxFeatures {
|
|
|
|
|
Get-AppxPackage -AllUsers "Microsoft.XboxIdentityProvider" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
Get-AppxPackage -AllUsers "Microsoft.XboxSpeechToTextOverlay" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
Get-AppxPackage -AllUsers "Microsoft.XboxGameOverlay" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
Get-AppxPackage -AllUsers "Microsoft.Xbox.TCUI" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_Enabled" -Type DWord -Value 1
|
|
|
|
|
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" -Name "AllowGameDVR" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Disable built-in Adobe Flash in IE and Edge
|
|
|
|
|
Function DisableAdobeFlash {
|
|
|
|
|
Write-Host "Disabling built-in Adobe Flash in IE and Edge..."
|
|
|
|
|
If (!(Test-Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\Addons")) {
|
|
|
|
|
New-Item -Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\Addons" -Force | Out-Null
|
|
|
|
|
}
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\Addons" -Name "FlashPlayerEnabled" -Type DWord -Value 0
|
|
|
|
|
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{D27CDB6E-AE6D-11CF-96B8-444553540000}")) {
|
|
|
|
|
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{D27CDB6E-AE6D-11CF-96B8-444553540000}" -Force | Out-Null
|
|
|
|
|
}
|
|
|
|
|
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{D27CDB6E-AE6D-11CF-96B8-444553540000}" -Name "Flags" -Type DWord -Value 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Enable built-in Adobe Flash in IE and Edge
|
|
|
|
|
Function EnableAdobeFlash {
|
|
|
|
|
Write-Host "Enabling built-in Adobe Flash in IE and Edge..."
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\Addons" -Name "FlashPlayerEnabled" -ErrorAction SilentlyContinue
|
|
|
|
|
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{D27CDB6E-AE6D-11CF-96B8-444553540000}" -Name "Flags" -ErrorAction SilentlyContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Uninstall Windows Media Player
|
|
|
|
|
Function UninstallMediaPlayer {
|
|
|
|
|
Write-Host "Uninstalling Windows Media Player..."
|
|
|
|
|
@@ -1290,7 +1612,7 @@ Function InstallWorkFolders {
|
|
|
|
|
Enable-WindowsOptionalFeature -Online -FeatureName "WorkFolders-Client" -NoRestart -WarningAction SilentlyContinue | Out-Null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Install Linux Subsystem - Applicable to RS1 or newer, not applicable to Server yet
|
|
|
|
|
# Install Linux Subsystem - Applicable to 1607 or newer, not applicable to Server yet
|
|
|
|
|
Function InstallLinuxSubsystem {
|
|
|
|
|
Write-Host "Installing Linux Subsystem..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowDevelopmentWithoutDevLicense" -Type DWord -Value 1
|
|
|
|
|
@@ -1298,7 +1620,7 @@ Function InstallLinuxSubsystem {
|
|
|
|
|
Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Windows-Subsystem-Linux" -NoRestart -WarningAction SilentlyContinue | Out-Null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Uninstall Linux Subsystem - Applicable to RS1 or newer, not applicable to Server yet
|
|
|
|
|
# Uninstall Linux Subsystem - Applicable to 1607 or newer, not applicable to Server yet
|
|
|
|
|
Function UninstallLinuxSubsystem {
|
|
|
|
|
Write-Host "Uninstalling Linux Subsystem..."
|
|
|
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowDevelopmentWithoutDevLicense" -Type DWord -Value 0
|
|
|
|
|
@@ -1519,12 +1841,22 @@ Function EnableIEEnhancedSecurity {
|
|
|
|
|
# Auxiliary Functions
|
|
|
|
|
##########
|
|
|
|
|
|
|
|
|
|
# Relaunch the script with administrator privileges
|
|
|
|
|
Function RequireAdmin {
|
|
|
|
|
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) {
|
|
|
|
|
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`" $PSCommandArgs" -WorkingDirectory $pwd -Verb RunAs
|
|
|
|
|
Exit
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Wait for key press
|
|
|
|
|
Function WaitForKey {
|
|
|
|
|
Write-Host
|
|
|
|
|
Write-Host "Press any key to continue..." -ForegroundColor Black -BackgroundColor White
|
|
|
|
|
[Console]::ReadKey($true) | Out-Null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Restart computer
|
|
|
|
|
Function Restart {
|
|
|
|
|
Write-Host "Restarting..."
|
|
|
|
|
Restart-Computer
|
|
|
|
|
@@ -1536,17 +1868,19 @@ Function Restart {
|
|
|
|
|
# Parse parameters and apply tweaks
|
|
|
|
|
##########
|
|
|
|
|
|
|
|
|
|
# Ask for elevated privileges if required
|
|
|
|
|
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) {
|
|
|
|
|
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`" $args" -WorkingDirectory $pwd -Verb RunAs
|
|
|
|
|
Exit
|
|
|
|
|
# Normalize path to preset file
|
|
|
|
|
$preset = ""
|
|
|
|
|
$PSCommandArgs = $args
|
|
|
|
|
If ($args -And $args[0].ToLower() -eq "-preset") {
|
|
|
|
|
$preset = Resolve-Path $($args | Select-Object -Skip 1)
|
|
|
|
|
$PSCommandArgs = "-preset `"$preset`""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Load function names from command line arguments or a preset file
|
|
|
|
|
If ($args) {
|
|
|
|
|
$tweaks = $args
|
|
|
|
|
If ($args[0].ToLower() -eq "-preset") {
|
|
|
|
|
$tweaks = Get-Content $args[1] -ErrorAction Stop | ForEach { $_.Trim() } | Where { $_ -ne "" -and $_[0] -ne "#" }
|
|
|
|
|
If ($preset) {
|
|
|
|
|
$tweaks = Get-Content $preset -ErrorAction Stop | ForEach { $_.Trim() } | Where { $_ -ne "" -and $_[0] -ne "#" }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|