37 Commits
2.9 ... 2.12

Author SHA1 Message Date
Disassembler
e24132e074 v2.12, 2018-01-09
- Add "Enable Meltdown (CVE-2017-5754) compatibility flag"
 - Add "Unpin Start Menu tiles" + "Unpin Taskbar icons" (kinda experimental)
 - Fix "Enable Storage Sense" by setting more registries (thx @zerolagaux)
 - Add more 3rd bloatware for removal (thx @zerolagaux)
 - Comment "Enable Controlled Folder Access" from default preset as it conflicts with some installers
 - Disable scheduled tasks related to Telemetry, Feedback and error reporting (thx @xomx)
2018-01-09 16:49:57 +01:00
Disassembler
04b85dac57 Disable tasks related to Telemetry, Feedback and error reporting, closes #37 for now (thx @xomx) 2018-01-09 16:49:08 +01:00
Disassembler
18e75afef6 Add "Unpin Start Menu tiles" + "Unpin Taskbar icons", closes #8 2018-01-09 14:05:59 +01:00
Disassembler
46f3881d2b Unify coding style for Remove-Item, Get-ChildItem and ForEach 2018-01-09 14:02:38 +01:00
Disassembler
b67276058b Remove even more 3rd bloatware, closes #54 (thx @zerolagaux) 2018-01-09 10:13:18 +01:00
Disassembler
8d468e7df1 Set more EnableStorageSense registries, fixes #53 (thx @zerolagaux) 2018-01-09 10:13:00 +01:00
Disassembler
ebaa3d0ba7 Add "Enable Meltdown (CVE-2017-5754) compatibility flag" (commented by default) 2018-01-08 20:54:01 +01:00
Disassembler
e9b915a2da Comment EnableCtrldFolderAccess from default preset as it conflicts with some installers + Fix typo. 2017-12-30 13:24:43 +01:00
Disassembler
3e1c7feeb6 v2.11, 2017-12-27
- Add "Disable Windows Defender Cloud" (thx @bajasoft)
 - Add "Set Control Panel view to icons (Classic)" (thx @DavidBrockmeier)
 - Add "Disable automatic installation of network devices"
 - Add "Disable Sleep start menu and keyboard button" (thx @thecek)
 - Add "Disable display and sleep mode timeouts" (thx @thecek)
 - Add more registry keys for "Disable Wi-Fi Sense" (thx @kukubau)
 - Remove even more bloatware (thx @thecek)
 - Update "Disable Background apps" to not break start menu search
 - Add both ways of hiding Library icons in This PC (either only in This PC or also in other Explorer windows like Personal Folders and open/save dialog)
2017-12-27 19:49:14 +01:00
Disassembler
491be4acc2 Suppress few more warnings when adding/removing nonexistant keys 2017-12-27 19:42:33 +01:00
Disassembler
538a1fdd39 Reintroduce post-1.5 way of hiding icons in Explorer once again
(Previously reverted in 157bf35, related to #36. Sorry for the bloat, I really hate these icons)
2017-12-27 17:58:28 +01:00
Disassembler
50362f37e1 Update DisableBackgroundApps to not break start menu search, again closes #42 2017-12-27 15:52:52 +01:00
Disassembler
871cad8660 Add "Disable display and sleep mode timeouts", closes #50, thx @thecek 2017-12-27 14:19:12 +01:00
Disassembler
5eb8a84dce Add "Disable Sleep start menu and keyboard button" as suggested in #50 2017-12-27 13:56:50 +01:00
Disassembler
d93d5ac4df Add more registry keys for "Disable Wi-Fi Sense", closes #48, thx @kukubau 2017-12-27 10:54:36 +01:00
Disassembler
b6840e2ba2 Add "Disable automatic installation of network devices", closes #47 2017-12-27 10:46:41 +01:00
Disassembler
6830298064 Add "Set Control Panel view to icons (Classic)", reimplements #45, thx @DavidBrockmeier 2017-12-27 09:56:20 +01:00
Disassembler
39a1d9022d Remove more bloatware, closes #43 (thx @thecek) 2017-12-01 16:59:12 +01:00
Disassembler
3f9e7e84a1 Another take on "Disable Background apps" related to #40 and #42 2017-11-13 19:10:19 +01:00
Disassembler
59b2000f6c Fix typo in default preset 2017-11-11 20:27:24 +01:00
Disassembler
b1447c0fc9 Don't apply "DisableBackgroundApps" in default preset, closes #40
+ Add tests for "EnableDefenderCloud"
2017-11-10 16:24:54 +01:00
Jan Bajer
c79ed38b66 Add "Disable Windows Defender Cloud" (#41) 2017-11-10 14:06:35 +01:00
Disassembler
c935abafa3 v2.10, 2017-11-09
- Add "Enable Controlled Folder Access"
- Add "Disable Lock screen Spotlight"
- Add "Enable Storage Sense"
- Add "Show User Folder on desktop"
- Add "Disable Background application access"
- Update "Disable Start Menu suggestions" (thx @Dvorak-Stepan)
- Update bloatware removal list with Print3D and Xbox.TCUI
- Update "Disable Advertising ID" to disable also advertisement telemetry
- Merge "DisableConsumerApps" and "DisableStartSuggestions" into "DisableAppSuggestions"
- Update the way of hiding icons in This PC, so they're not hidden also in personal folders
2017-11-10 00:06:10 +01:00
Disassembler
14bf1e8477 Add additional check in "Disable Advertising ID", remove unnecessary -Force 2017-11-10 00:03:59 +01:00
Disassembler
2f8e43cc03 Add "Enable Storage Sense", closes #39 2017-11-09 23:34:39 +01:00
Disassembler
e0c9dd1df7 Add "Disable Background application access", related to #39 2017-11-09 22:33:04 +01:00
Disassembler
157bf356dc Revert to pre-1.5 way of hiding icons from This PC, kinda fixes #36.
Less reliable, but doesn't hide them in Personal folders.
2017-11-09 22:07:54 +01:00
Disassembler
d1089630c5 Add "Show User Folder on desktop", related to #39 2017-11-09 21:40:33 +01:00
Disassembler
936e0da7ec Merge DisableConsumerApps into DisableAppSuggestions, closes #35 2017-11-09 21:27:55 +01:00
Disassembler
71b8166b9e Rename DisableStartSuggestions to DisableAppSuggestions and add few more Content Delivery Manager values, related to #35 2017-11-09 21:24:02 +01:00
Disassembler
23f19fd851 Add "Disable Lock screen Spotlight", related to #35 2017-11-09 21:08:39 +01:00
Disassembler
9c957d217c Fix typo in "Show network options on lock screen" registry hive 2017-11-09 21:08:14 +01:00
Disassembler
90deb26b55 Update "Disable Advertising ID" to disable also advertisement telemetry 2017-11-09 19:35:52 +01:00
Disassembler
dac835801a Add some more bloatware for removal, closes #38 2017-11-09 19:17:09 +01:00
Disassembler
ad09c6ec67 Update "Disable Start Menu suggestions" for 1709, closes #35 (thx @Dvorak-Stepan) 2017-10-31 14:04:32 +01:00
Disassembler
11dd5c64e5 Add "Enable Controlled Folder Access", closes #33 2017-10-27 14:50:44 +02:00
Disassembler0
1f67aedeab Clarify defaults and fix typo in README 2017-10-22 17:08:02 +02:00
6 changed files with 544 additions and 66 deletions

View File

@@ -50,7 +50,7 @@ Command using the preset file above:
**A:** Yes. I'm testing new additions on up-to-date Home and Enterprise editions in VMs. I'm also regularly using it for all my home installations after all bigger updates.
**Q**: I've run the script and it did xxx, how can I undo it?
**A:** For every tweak, there is also a corresponding function which restores the default settings. Use them to create and run new preset. Alternatively, since most functions are just automation for actions which can be done using GUI, find appropriate control and modify it manually.
**A:** For every tweak, there is also a corresponding function which restores the default settings. The default is considered freshly installed Windows 10 or Windows Server 2016 with no adjustments made during or after the installation. Use the tweaks to create and run new preset. Alternatively, since most functions are just automation for actions which can be done using GUI, find appropriate control and modify it manually.
**Q:** I've run the script and it broke my computer / killed neighbor's dog / caused world war 3.
**A:** I don't care. Also, that's not a question.
@@ -86,8 +86,8 @@ Check if there isn't already a function with similar purpose as the one you are
### Function grouping
Try to group functions thematically. There are already five major groups (privacy, services, user interface, applications and server-specific), but even within these, some tweaks may be related to each other. In such case, add a new tweak below the existing one and not to the end of the whole group.
### Default settings
Always add a reference to the tweak and its revert function in the `$tweaks` array containing the default settings. Add references to both functions on the same line (mind the quotes and commas) and always comment out the revert function. Whether to comment out also the tweak in the default preset is a matter of personal preference. The rule of thumb is that if the tweak makes the system faster, smoother, more secure and less obtrusive, it should be enabled by default. Usability has preference over performance (that's why e.g. indexing is kept enabled). Also don't forget to add the function references to all test files.
### Default preset
Always add a reference to the tweak and its revert function in the `$tweaks` array containing the default set of tweaks. Add references to both functions on the same line (mind the quotes and commas) and always comment out the revert function. Whether to comment out also the tweak in the default preset is a matter of personal preference. The rule of thumb is that if the tweak makes the system faster, smoother, more secure and less obtrusive, it should be enabled by default. Usability has preference over performance (that's why e.g. indexing is kept enabled). Also don't forget to add the function references to all test files.
### Repeatability
Unless applied on unsupported system, all functions have to be applicable repeatedly without any errors. When you're creating a registry key, always check first if the key doesn't happen to already exist. When you're deleting registry value, always append `-ErrorAction SilentlyContinue` to prevent errors while deleting already deleted values.
@@ -96,7 +96,7 @@ Unless applied on unsupported system, all functions have to be applicable repeat
Suppress all output generated by commands and cmdlets using `| Out-Null` or `-ErrorAction SilentlyContinue` where applicable. Whenever an input is needed, use appropriate parameters to suppress the prompt and programmatically provide values for the command to run (eg. using `-Confirm:$false`). The only acceptable output is from the `Write-Host` cmdlets in the beginning of each function and from non-suppressible cmdlets like `Remove-AppxPackage`.
### Registry
Create the registry keys only if they don't exist on fresh installation if Windows 10 or Windows Server 2016. When deleting registry, delete only registry values, not the whole keys. When you're setting registry values, always use `Set-ItemProperty` instead of `New-ItemProperty`. When you're removing registry values, choose either `Set-ItemProperty` or `Remove-ItemProperty` to reinstate the same situation as it was on the clean installation. Again, if you don't know what the original state was, let me know in PR description and I will fill in th gaps. When you need to use `HKEY_USERS` registry hive, always add following snippet before the registry modification to ensure portability.
Create the registry keys only if they don't exist on fresh installation if Windows 10 or Windows Server 2016. When deleting registry, delete only registry values, not the whole keys. When you're setting registry values, always use `Set-ItemProperty` instead of `New-ItemProperty`. When you're removing registry values, choose either `Set-ItemProperty` or `Remove-ItemProperty` to reinstate the same situation as it was on the clean installation. Again, if you don't know what the original state was, let me know in PR description and I will fill in the gaps. When you need to use `HKEY_USERS` registry hive, always add following snippet before the registry modification to ensure portability.
```powershell
If (!(Test-Path "HKU:")) {

512
Win10.ps1
View File

@@ -1,7 +1,7 @@
##########
# Win10 / WinServer2016 Initial Setup Script
# Author: Disassembler <disassembler@dasm.cz>
# Version: v2.9, 2017-10-22
# Version: v2.12, 2018-01-09
# Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
##########
@@ -15,7 +15,9 @@ $tweaks = @(
"DisableWiFiSense", # "EnableWiFiSense",
# "DisableSmartScreen", # "EnableSmartScreen",
"DisableWebSearch", # "EnableWebSearch",
"DisableStartSuggestions", # "EnableStartSuggestions",
"DisableAppSuggestions", # "EnableAppSuggestions",
"DisableBackgroundApps", # "EnableBackgroundApps",
"DisableLockScreenSpotlight", # "EnableLockScreenSpotlight",
"DisableLocationTracking", # "EnableLocationTracking",
"DisableMapUpdates", # "EnableMapUpdates",
"DisableFeedback", # "EnableFeedback",
@@ -34,8 +36,11 @@ $tweaks = @(
# "DisableSMB1", # "EnableSMB1",
"SetCurrentNetworkPrivate", # "SetCurrentNetworkPublic",
# "SetUnknownNetworksPrivate", # "SetUnknownNetworksPublic",
# "DisableNetDevicesAutoInst", # "EnableNetDevicesAutoInst",
# "EnableCtrldFolderAccess", # "DisableCtrldFolderAccess",
# "DisableFirewall", # "EnableFirewall",
# "DisableDefender", # "EnableDefender",
# "DisableDefenderCloud", # "EnableDefenderCloud",
# "DisableUpdateMSRT", # "EnableUpdateMSRT",
# "DisableUpdateDriver", # "EnableUpdateDriver",
"DisableUpdateRestart", # "EnableUpdateRestart",
@@ -45,11 +50,14 @@ $tweaks = @(
"EnableRemoteDesktop", # "DisableRemoteDesktop",
"DisableAutoplay", # "EnableAutoplay",
"DisableAutorun", # "EnableAutorun",
# "EnableStorageSense", # "DisableStorageSense",
# "DisableDefragmentation", # "EnableDefragmentation",
# "DisableSuperfetch", # "EnableSuperfetch",
# "DisableIndexing", # "EnableIndexing",
# "SetBIOSTimeUTC", # "SetBIOSTimeLocal",
# "EnableHibernation", # "DisableHibernation",
# "DisableSleepButton", # "EnableSleepButton",
# "DisableSleepTimeout", # "EnableSleepTimeout",
# "DisableFastStartup", # "EnableFastStartup",
### UI Tweaks ###
@@ -74,13 +82,22 @@ $tweaks = @(
"HideRecentShortcuts", # "ShowRecentShortcuts",
"SetExplorerThisPC", # "SetExplorerQuickAccess",
"ShowThisPCOnDesktop", # "HideThisPCFromDesktop",
# "ShowUserFolderOnDesktop", # "HideUserFolderFromDesktop",
"HideDesktopFromThisPC", # "ShowDesktopInThisPC",
# "HideDesktopFromExplorer", # "ShowDesktopInExplorer",
"HideDocumentsFromThisPC", # "ShowDocumentsInThisPC",
# "HideDocumentsFromExplorer", # "ShowDocumentsInExplorer",
"HideDownloadsFromThisPC", # "ShowDownloadsInThisPC",
# "HideDownloadsFromExplorer", # "ShowDownloadsInExplorer",
"HideMusicFromThisPC", # "ShowMusicInThisPC",
# "HideMusicFromExplorer", # "ShowMusicInExplorer",
"HidePicturesFromThisPC", # "ShowPicturesInThisPC",
# "HidePicturesFromExplorer", # "ShowPicturesInExplorer",
"HideVideosFromThisPC", # "ShowVideosInThisPC",
# "HideVideosFromExplorer", # "ShowVideosInExplorer",
"Hide3DObjectsFromThisPC", # "Show3DObjectsInThisPC",
# "Hide3DObjectsFromExplorer", # "Show3DObjectsInExplorer",
# "SetControlPanelViewIcons", # "SetControlPanelViewCategories",
"SetVisualFXPerformance", # "SetVisualFXAppearance",
# "DisableThumbnails", # "EnableThumbnails",
"DisableThumbsDB", # "EnableThumbsDB",
@@ -93,7 +110,6 @@ $tweaks = @(
"UninstallMsftBloat", # "InstallMsftBloat",
"UninstallThirdPartyBloat", # "InstallThirdPartyBloat",
# "UninstallWindowsStore", # "InstallWindowsStore",
"DisableConsumerApps", # "EnableConsumerApps",
"DisableXboxFeatures", # "EnableXboxFeatures",
"DisableAdobeFlash", # "EnableAdobeFlash",
# "UninstallMediaPlayer", # "InstallMediaPlayer",
@@ -106,6 +122,7 @@ $tweaks = @(
"DisableNewAppPrompt", # "EnableNewAppPrompt",
"EnableF8BootMenu", # "DisableF8BootMenu",
"SetDEPOptOut", # "SetDEPOptIn",
# "EnableMeltdownCompatFlag" # "DisableMeltdownCompatFlag",
### Server Specific Tweaks ###
# "HideServerManagerOnLogin", # "ShowServerManagerOnLogin",
@@ -114,6 +131,10 @@ $tweaks = @(
# "DisableCtrlAltDelLogin", # "EnableCtrlAltDelLogin",
# "DisableIEEnhancedSecurity", # "EnableIEEnhancedSecurity",
### Unpinning ###
# "UnpinStartMenuTiles",
# "UnpinTaskbarIcons",
### Auxiliary Functions ###
"WaitForKey",
"Restart"
@@ -131,6 +152,12 @@ Function DisableTelemetry {
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\ProgramDataUpdater" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Autochk\Proxy" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null
}
# Enable Telemetry
@@ -139,6 +166,12 @@ Function EnableTelemetry {
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 3
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 3
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 3
Enable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\ProgramDataUpdater" | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\Autochk\Proxy" | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null
}
# Disable Wi-Fi Sense
@@ -149,6 +182,11 @@ Function DisableWiFiSense {
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" -Name "AutoConnectAllowedOEM" -Type Dword -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" -Name "WiFISenseAllowed" -Type Dword -Value 0
}
# Enable Wi-Fi Sense
@@ -159,6 +197,8 @@ Function EnableWiFiSense {
}
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
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" -Name "AutoConnectAllowedOEM" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" -Name "WiFISenseAllowed" -ErrorAction SilentlyContinue
}
# Disable SmartScreen Filter
@@ -201,18 +241,69 @@ 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 when they aren't used - Cortana is excluded as its inclusion breaks start menu search
Function DisableBackgroundApps {
Write-Host "Disabling Background application access..."
Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Exclude "Microsoft.Windows.Cortana*" | ForEach {
Set-ItemProperty -Path $_.PsPath -Name "Disabled" -Type DWord -Value 1
Set-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -Type DWord -Value 1
}
}
# Enable Background application access
Function EnableBackgroundApps {
Write-Host "Enabling Background application access..."
Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" | ForEach {
Remove-ItemProperty -Path $_.PsPath -Name "Disabled" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -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
@@ -248,12 +339,16 @@ Function DisableFeedback {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0
Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClient" -ErrorAction SilentlyContinue | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" -ErrorAction SilentlyContinue | Out-Null
}
# Enable Feedback
Function EnableFeedback {
Write-Host "Enabling Feedback..."
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -ErrorAction SilentlyContinue
Enable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClient" -ErrorAction SilentlyContinue | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" -ErrorAction SilentlyContinue | Out-Null
}
# Disable Advertising ID
@@ -263,12 +358,20 @@ 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
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 2
}
# Disable Cortana
@@ -310,12 +413,14 @@ Function EnableCortana {
Function DisableErrorReporting {
Write-Host "Disabling Error reporting..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -Type DWord -Value 1
Disable-ScheduledTask -TaskName "Microsoft\Windows\Windows Error Reporting\QueueReporting" | Out-Null
}
# Enable Error reporting
Function EnableErrorReporting {
Write-Host "Enabling Error reporting..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -ErrorAction SilentlyContinue
Enable-ScheduledTask -TaskName "Microsoft\Windows\Windows Error Reporting\QueueReporting" | Out-Null
}
# Restrict Windows Update P2P only to local network
@@ -343,7 +448,7 @@ Function DisableAutoLogger {
Write-Host "Removing AutoLogger file and restricting directory..."
$autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger"
If (Test-Path "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl") {
Remove-Item "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl"
Remove-Item -Path "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl"
}
icacls $autoLoggerDir /deny SYSTEM:`(OI`)`(CI`)F | Out-Null
}
@@ -467,6 +572,33 @@ Function SetUnknownNetworksPublic {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\010103000F0000F0010000000F0000F0C967A3643C3AD745950DA7859209176EF5B87C875FA20DF21951640E807D7C24" -Name "Category" -ErrorAction SilentlyContinue
}
# Disable automatic installation of network devices
Function DisableNetDevicesAutoInst {
Write-Host "Disabling automatic installation of network devices..."
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\NcdAutoSetup\Private")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\NcdAutoSetup\Private" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\NcdAutoSetup\Private" -Name "AutoSetup" -Type DWord -Value 0
}
# Enable automatic installation of network devices
Function EnableNetDevicesAutoInst {
Write-Host "Enabling automatic installation of network devices..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\NcdAutoSetup\Private" -Name "AutoSetup" -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..."
@@ -499,6 +631,23 @@ Function EnableDefender {
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name "SecurityHealth" -Type ExpandString -Value "`"%ProgramFiles%\Windows Defender\MSASCuiL.exe`""
}
# Disable Windows Defender Cloud
Function DisableDefenderCloud {
Write-Host "Disabling Windows Defender Cloud..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" -Name "SpynetReporting" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" -Name "SubmitSamplesConsent" -Type DWord -Value 2
}
# Enable Windows Defender Cloud
Function EnableDefenderCloud {
Write-Host "Enabling Windows Defender Cloud..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" -Name "SpynetReporting" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" -Name "SubmitSamplesConsent" -ErrorAction SilentlyContinue
}
# Disable offering of Malicious Software Removal Tool through Windows Update
Function DisableUpdateMSRT {
Write-Host "Disabling Malicious Software Removal Tool offering..."
@@ -630,6 +779,25 @@ 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..."
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" -Name "01" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" -Name "04" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" -Name "08" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" -Name "32" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" -Name "StoragePoliciesNotified" -Type DWord -Value 1
}
# Disable Storage Sense - Not applicable to Server
Function DisableStorageSense {
Write-Host "Disabling Storage Sense..."
Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" -Recurse -ErrorAction SilentlyContinue
}
# Disable scheduled defragmentation task
Function DisableDefragmentation {
Write-Host "Disabling scheduled defragmentation..."
@@ -703,6 +871,46 @@ Function DisableHibernation {
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" -Name "ShowHibernateOption" -Type Dword -Value 0
}
# Disable Sleep start menu and keyboard button
Function DisableSleepButton {
Write-Host "Disabling Sleep start menu and keyboard button..."
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 "ShowSleepOption" -Type Dword -Value 0
powercfg /SETACVALUEINDEX SCHEME_CURRENT SUB_BUTTONS SBUTTONACTION 0
powercfg /SETDCVALUEINDEX SCHEME_CURRENT SUB_BUTTONS SBUTTONACTION 0
}
# Enable Sleep start menu and keyboard button
Function EnableSleepButton {
Write-Host "Enabling Sleep start menu and keyboard button..."
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 "ShowSleepOption" -Type Dword -Value 1
powercfg /SETACVALUEINDEX SCHEME_CURRENT SUB_BUTTONS SBUTTONACTION 1
powercfg /SETDCVALUEINDEX SCHEME_CURRENT SUB_BUTTONS SBUTTONACTION 1
}
# Disable display and sleep mode timeouts
Function DisableSleepTimeout {
Write-Host "Disabling display and sleep mode timeouts..."
powercfg /X monitor-timeout-ac 0
powercfg /X monitor-timeout-dc 0
powercfg /X standby-timeout-ac 0
powercfg /X standby-timeout-dc 0
}
# Enable display and sleep mode timeouts
Function EnableSleepTimeout {
Write-Host "Enabling display and sleep mode timeouts..."
powercfg /X monitor-timeout-ac 10
powercfg /X monitor-timeout-dc 5
powercfg /X standby-timeout-ac 30
powercfg /X standby-timeout-dc 15
}
# Disable Fast Startup
Function DisableFastStartup {
Write-Host "Disabling Fast Startup..."
@@ -784,7 +992,7 @@ Function HideNetworkFromLockScreen {
# Show network options on lock screen
Function ShowNetworkOnLockScreen {
Write-Host "Showing network options on Lock Screen..."
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "DontDisplayNetworkSelectionUI" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "DontDisplayNetworkSelectionUI" -ErrorAction SilentlyContinue
}
# Hide shutdown options from Lock Screen
@@ -1027,93 +1235,231 @@ Function HideThisPCFromDesktop {
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -ErrorAction SilentlyContinue
}
# Hide Desktop icon from This PC
# 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 - The icon remains in personal folders and open/save dialogs
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..."
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 Desktop icon from Explorer namespace - Hides the icon also from personal folders and open/save dialogs
Function HideDesktopFromExplorer {
Write-Host "Hiding Desktop icon from Explorer namespace..."
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"
}
# Show Desktop icon in Explorer namespace
Function ShowDesktopInExplorer {
Write-Host "Showing Desktop icon in Explorer namespace..."
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"
}
# Hide Documents icon from This PC
# Hide Documents icon from This PC - The icon remains in personal folders and open/save dialogs
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..."
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 Documents icon from Explorer namespace - Hides the icon also from personal folders and open/save dialogs
Function HideDocumentsFromExplorer {
Write-Host "Hiding Documents icon from Explorer namespace..."
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"
}
# Show Documents icon in Explorer namespace
Function ShowDocumentsInExplorer {
Write-Host "Showing Documents icon in Explorer namespace..."
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"
}
# Hide Downloads icon from This PC
# Hide Downloads icon from This PC - The icon remains in personal folders and open/save dialogs
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..."
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 Downloads icon from Explorer namespace - Hides the icon also from personal folders and open/save dialogs
Function HideDownloadsFromExplorer {
Write-Host "Hiding Downloads icon from Explorer namespace..."
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"
}
# Show Downloads icon in Explorer namespace
Function ShowDownloadsInExplorer {
Write-Host "Showing Downloads icon in Explorer namespace..."
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"
}
# Hide Music icon from This PC
# Hide Music icon from This PC - The icon remains in personal folders and open/save dialogs
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..."
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 Music icon from Explorer namespace - Hides the icon also from personal folders and open/save dialogs
Function HideMusicFromExplorer {
Write-Host "Hiding Music icon from Explorer namespace..."
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"
}
# Show Music icon in Explorer namespace
Function ShowMusicInExplorer {
Write-Host "Showing Music icon in Explorer namespace..."
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"
}
# Hide Pictures icon from This PC
# Hide Pictures icon from This PC - The icon remains in personal folders and open/save dialogs
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..."
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 Pictures icon from Explorer namespace - Hides the icon also from personal folders and open/save dialogs
Function HidePicturesFromExplorer {
Write-Host "Hiding Pictures icon from Explorer namespace..."
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"
}
# Show Pictures icon in Explorer namespace
Function ShowPicturesInExplorer {
Write-Host "Showing Pictures icon in Explorer namespace..."
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"
}
# Hide Videos icon from This PC
# Hide Videos icon from This PC - The icon remains in personal folders and open/save dialogs
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..."
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 Videos icon from Explorer namespace - Hides the icon also from personal folders and open/save dialogs
Function HideVideosFromExplorer {
Write-Host "Hiding Videos icon from Explorer namespace..."
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"
}
# Show Videos icon in Explorer namespace
Function ShowVideosInExplorer {
Write-Host "Showing Videos icon in Explorer namespace..."
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"
}
# Hide 3D Objects icon from This PC
# Hide 3D Objects icon from This PC - The icon remains in personal folders and open/save dialogs
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
}
}
# Hide 3D Objects icon from Explorer namespace - Hides the icon also from personal folders and open/save dialogs
Function Hide3DObjectsFromExplorer {
Write-Host "Hiding 3D Objects icon from Explorer namespace..."
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Force | Out-Null
}
@@ -1124,13 +1470,25 @@ Function Hide3DObjectsFromThisPC {
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
}
# Show 3D Objects icon in This PC
Function Show3DObjectsInThisPC {
Write-Host "Showing 3D Objects icon in This PC..."
# Show 3D Objects icon in Explorer namespace
Function Show3DObjectsInExplorer {
Write-Host "Showing 3D Objects icon in Explorer namespace..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name "ThisPCPolicy" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name "ThisPCPolicy" -ErrorAction SilentlyContinue
}
# Set Control Panel view to icons (Classic) - Note: May trigger antimalware
Function SetControlPanelViewIcons {
Write-Host "Setting Control Panel view to icons..."
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "ForceClassicControlPanel" -Type DWord -Value 1
}
# Set Control Panel view to categories
Function SetControlPanelViewCategories {
Write-Host "Setting Control Panel view to categories..."
Remove-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "ForceClassicControlPanel" -ErrorAction SilentlyContinue
}
# 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..."
@@ -1264,10 +1622,10 @@ Function UninstallOneDrive {
Start-Sleep -s 3
Stop-Process -Name explorer -ErrorAction SilentlyContinue
Start-Sleep -s 3
Remove-Item "$env:USERPROFILE\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item "$env:LOCALAPPDATA\Microsoft\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item "$env:PROGRAMDATA\Microsoft OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item "$env:SYSTEMDRIVE\OneDriveTemp" -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path "$env:USERPROFILE\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path "$env:PROGRAMDATA\Microsoft OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path "$env:SYSTEMDRIVE\OneDriveTemp" -Force -Recurse -ErrorAction SilentlyContinue
If (!(Test-Path "HKCR:")) {
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
}
@@ -1322,6 +1680,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
@@ -1361,6 +1720,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
@@ -1389,6 +1749,14 @@ function UninstallThirdPartyBloat {
Get-AppxPackage "king.com.BubbleWitch3Saga" | Remove-AppxPackage
Get-AppxPackage "89006A2E.AutodeskSketchBook" | Remove-AppxPackage
Get-AppxPackage "CAF9E577.Plex" | Remove-AppxPackage
Get-AppxPackage "A278AB0D.DisneyMagicKingdoms" | Remove-AppxPackage
Get-AppxPackage "828B5831.HiddenCityMysteryofShadows" | Remove-AppxPackage
Get-AppxPackage "WinZipComputing.WinZipUniversal" | Remove-AppxPackage
Get-AppxPackage "SpotifyAB.SpotifyMusic" | Remove-AppxPackage
Get-AppxPackage "PandoraMediaInc.29680B314EFC2" | Remove-AppxPackage
Get-AppxPackage "2414FC7A.Viber" | Remove-AppxPackage
Get-AppxPackage "64885BlueEdge.OneCalendar" | Remove-AppxPackage
Get-AppxPackage "41038Axilesoft.ACGMediaPlayer" | Remove-AppxPackage
}
# Install default third party applications
@@ -1411,6 +1779,14 @@ Function InstallThirdPartyBloat {
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"}
Get-AppxPackage -AllUsers "A278AB0D.DisneyMagicKingdoms" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "828B5831.HiddenCityMysteryofShadows" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "WinZipComputing.WinZipUniversal" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "SpotifyAB.SpotifyMusic" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "PandoraMediaInc.29680B314EFC2" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "2414FC7A.Viber" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "64885BlueEdge.OneCalendar" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "41038Axilesoft.ACGMediaPlayer" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
}
# Uninstall Windows Store
@@ -1427,21 +1803,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..."
@@ -1449,6 +1810,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
@@ -1463,6 +1825,7 @@ 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
}
@@ -1652,6 +2015,24 @@ Function SetDEPOptIn {
bcdedit /set `{current`} nx OptIn | Out-Null
}
# Enable Meltdown (CVE-2017-5754) compatibility flag - Required for January 2018 and all subsequent Windows updates
# This flag is normally automatically enabled by compatible antivirus software (such as Windows Defender).
# Use the tweak only if you have confirmed that your AV is compatible but unable to set the flag automatically or if you don't use any AV at all.
# See https://support.microsoft.com/en-us/help/4072699/january-3-2018-windows-security-updates-and-antivirus-software for details.
Function EnableMeltdownCompatFlag {
Write-Host "Enabling Meltdown (CVE-2017-5754) compatibility flag..."
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\QualityCompat")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\QualityCompat" | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\QualityCompat" -Name "cadca5fe-87d3-4b96-b7fb-a231484277cc" -Type DWord -Value 0
}
# Disable Meltdown (CVE-2017-5754) compatibility flag
Function DisableMeltdownCompatFlag {
Write-Host "Disabling Meltdown (CVE-2017-5754) compatibility flag..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\QualityCompat" -Name "cadca5fe-87d3-4b96-b7fb-a231484277cc" -ErrorAction SilentlyContinue
}
##########
@@ -1736,6 +2117,29 @@ Function EnableIEEnhancedSecurity {
##########
# Unpinning
##########
# Unpin all Start Menu tiles - Not applicable to Server - Note: This function has no counterpart. You have to pin the tiles back manually.
Function UnpinStartMenuTiles {
Write-Host "Unpinning all Start Menu tiles"
Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount" -Include "*.group" -Recurse | ForEach-Object {
$data = (Get-ItemProperty -Path "$($_.PsPath)\Current" -Name "Data").Data -Join ","
$data = $data.Substring(0, $data.IndexOf(",0,202,30") + 9) + ",0,202,80,0,0"
Set-ItemProperty -Path "$($_.PsPath)\Current" -Name "Data" -Type Binary -Value $data.Split(",")
}
}
# Unpin all Taskbar icons - Note: This function has no counterpart. You have to pin the icons back manually.
Function UnpinTaskbarIcons {
Write-Host "Unpinning all Taskbar icons"
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -Name "Favorites" -Type Binary -Value ([byte[]](0xFF))
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -Name "FavoritesResolve" -ErrorAction SilentlyContinue
}
##########
# Auxiliary Functions
##########

View File

@@ -6,7 +6,9 @@ DisableTelemetry
DisableWiFiSense
DisableSmartScreen
DisableWebSearch
DisableStartSuggestions
DisableAppSuggestions
DisableBackgroundApps
DisableLockScreenSpotlight
DisableLocationTracking
DisableMapUpdates
DisableFeedback
@@ -24,8 +26,11 @@ DisableAdminShares
# DisableSMB1
SetCurrentNetworkPrivate
SetUnknownNetworksPrivate
DisableNetDevicesAutoInst
EnableCtrldFolderAccess
DisableFirewall
DisableDefender
DisableDefenderCloud
DisableUpdateMSRT
DisableUpdateDriver
DisableUpdateRestart
@@ -35,11 +40,14 @@ DisableRemoteAssistance
EnableRemoteDesktop
DisableAutoplay
DisableAutorun
EnableStorageSense
DisableDefragmentation
DisableSuperfetch
DisableIndexing
SetBIOSTimeUTC
EnableHibernation
DisableSleepButton
DisableSleepTimeout
DisableFastStartup
DisableActionCenter
@@ -63,13 +71,22 @@ HideSyncNotifications
HideRecentShortcuts
SetExplorerThisPC
ShowThisPCOnDesktop
ShowUserFolderOnDesktop
HideDesktopFromThisPC
HideDesktopFromExplorer
HideDocumentsFromThisPC
HideDocumentsFromExplorer
HideDownloadsFromThisPC
HideDownloadsFromExplorer
HideMusicFromThisPC
HideMusicFromExplorer
HidePicturesFromThisPC
HidePicturesFromExplorer
HideVideosFromThisPC
HideVideosFromExplorer
Hide3DObjectsFromThisPC
Hide3DObjectsFromExplorer
SetControlPanelViewIcons
SetVisualFXPerformance
DisableThumbnails
DisableThumbsDB
@@ -81,7 +98,6 @@ UninstallOneDrive
UninstallMsftBloat
UninstallThirdPartyBloat
UninstallWindowsStore
DisableConsumerApps
DisableXboxFeatures
DisableAdobeFlash
UninstallMediaPlayer
@@ -94,6 +110,7 @@ DisableSearchAppInStore
DisableNewAppPrompt
EnableF8BootMenu
SetDEPOptOut
EnableMeltdownCompatFlag
# HideServerManagerOnLogin
# DisableShutdownTracker
@@ -101,5 +118,8 @@ SetDEPOptOut
# DisableCtrlAltDelLogin
# DisableIEEnhancedSecurity
UnpinStartMenuTiles
UnpinTaskbarIcons
WaitForKey
Restart

View File

@@ -6,7 +6,9 @@ EnableTelemetry
EnableWiFiSense
EnableSmartScreen
EnableWebSearch
EnableStartSuggestions
EnableAppSuggestions
EnableBackgroundApps
EnableLockScreenSpotlight
EnableLocationTracking
EnableMapUpdates
EnableFeedback
@@ -24,8 +26,11 @@ EnableAdminShares
# EnableSMB1
SetCurrentNetworkPublic
SetUnknownNetworksPublic
EnableNetDevicesAutoInst
DisableCtrldFolderAccess
EnableFirewall
EnableDefender
EnableDefenderCloud
EnableUpdateMSRT
EnableUpdateDriver
EnableUpdateRestart
@@ -35,11 +40,14 @@ EnableRemoteAssistance
DisableRemoteDesktop
EnableAutoplay
EnableAutorun
DisableStorageSense
EnableDefragmentation
EnableSuperfetch
EnableIndexing
SetBIOSTimeLocal
DisableHibernation
EnableSleepButton
EnableSleepTimeout
EnableFastStartup
EnableActionCenter
@@ -63,13 +71,22 @@ ShowSyncNotifications
ShowRecentShortcuts
SetExplorerQuickAccess
HideThisPCFromDesktop
HideUserFolderFromDesktop
ShowDesktopInThisPC
ShowDesktopInExplorer
ShowDocumentsInThisPC
ShowDocumentsInExplorer
ShowDownloadsInThisPC
ShowDownloadsInExplorer
ShowMusicInThisPC
ShowMusicInExplorer
ShowPicturesInThisPC
ShowPicturesInExplorer
ShowVideosInThisPC
ShowVideosInExplorer
Show3DObjectsInThisPC
Show3DObjectsInExplorer
SetControlPanelViewCategories
SetVisualFXAppearance
EnableThumbnails
EnableThumbsDB
@@ -81,7 +98,6 @@ InstallOneDrive
InstallMsftBloat
InstallThirdPartyBloat
InstallWindowsStore
EnableConsumerApps
EnableXboxFeatures
EnableAdobeFlash
InstallMediaPlayer
@@ -94,6 +110,7 @@ EnableSearchAppInStore
EnableNewAppPrompt
DisableF8BootMenu
SetDEPOptIn
DisableMeltdownCompatFlag
# ShowServerManagerOnLogin
# EnableShutdownTracker

View File

@@ -6,7 +6,9 @@ DisableTelemetry
DisableWiFiSense
DisableSmartScreen
DisableWebSearch
DisableStartSuggestions
DisableAppSuggestions
DisableBackgroundApps
DisableLockScreenSpotlight
DisableLocationTracking
DisableMapUpdates
DisableFeedback
@@ -24,8 +26,11 @@ DisableAdminShares
DisableSMB1
SetCurrentNetworkPrivate
SetUnknownNetworksPrivate
DisableNetDevicesAutoInst
# EnableCtrldFolderAccess
DisableFirewall
DisableDefender
DisableDefenderCloud
DisableUpdateMSRT
DisableUpdateDriver
DisableUpdateRestart
@@ -35,11 +40,14 @@ DisableUpdateRestart
EnableRemoteDesktop
DisableAutoplay
DisableAutorun
# EnableStorageSense
DisableDefragmentation
# DisableSuperfetch
DisableIndexing
SetBIOSTimeUTC
EnableHibernation
DisableSleepButton
DisableSleepTimeout
DisableFastStartup
DisableActionCenter
@@ -63,13 +71,22 @@ HideSyncNotifications
HideRecentShortcuts
SetExplorerThisPC
ShowThisPCOnDesktop
ShowUserFolderOnDesktop
HideDesktopFromThisPC
HideDesktopFromExplorer
HideDocumentsFromThisPC
HideDocumentsFromExplorer
HideDownloadsFromThisPC
HideDownloadsFromExplorer
HideMusicFromThisPC
HideMusicFromExplorer
HidePicturesFromThisPC
HidePicturesFromExplorer
HideVideosFromThisPC
HideVideosFromExplorer
Hide3DObjectsFromThisPC
Hide3DObjectsFromExplorer
SetControlPanelViewIcons
SetVisualFXPerformance
DisableThumbnails
DisableThumbsDB
@@ -81,7 +98,6 @@ DisableOneDrive
UninstallMsftBloat
UninstallThirdPartyBloat
UninstallWindowsStore
DisableConsumerApps
DisableXboxFeatures
DisableAdobeFlash
UninstallMediaPlayer
@@ -94,6 +110,7 @@ DisableSearchAppInStore
DisableNewAppPrompt
EnableF8BootMenu
SetDEPOptOut
EnableMeltdownCompatFlag
HideServerManagerOnLogin
DisableShutdownTracker
@@ -101,5 +118,8 @@ DisablePasswordPolicy
DisableCtrlAltDelLogin
DisableIEEnhancedSecurity
# UnpinStartMenuTiles
UnpinTaskbarIcons
WaitForKey
Restart

View File

@@ -6,7 +6,9 @@ EnableTelemetry
EnableWiFiSense
EnableSmartScreen
EnableWebSearch
EnableStartSuggestions
EnableAppSuggestions
EnableBackgroundApps
EnableLockScreenSpotlight
EnableLocationTracking
EnableMapUpdates
EnableFeedback
@@ -24,8 +26,11 @@ EnableAdminShares
EnableSMB1
SetCurrentNetworkPublic
SetUnknownNetworksPublic
EnableNetDevicesAutoInst
# DisableCtrldFolderAccess
EnableFirewall
EnableDefender
EnableDefenderCloud
EnableUpdateMSRT
EnableUpdateDriver
EnableUpdateRestart
@@ -35,11 +40,14 @@ EnableUpdateRestart
DisableRemoteDesktop
EnableAutoplay
EnableAutorun
# DisableStorageSense
EnableDefragmentation
# EnableSuperfetch
EnableIndexing
SetBIOSTimeLocal
DisableHibernation
EnableSleepButton
EnableSleepTimeout
EnableFastStartup
EnableActionCenter
@@ -63,13 +71,22 @@ ShowSyncNotifications
ShowRecentShortcuts
SetExplorerQuickAccess
HideThisPCFromDesktop
HideUserFolderFromDesktop
ShowDesktopInThisPC
ShowDesktopInExplorer
ShowDocumentsInThisPC
ShowDocumentsInExplorer
ShowDownloadsInThisPC
ShowDownloadsInExplorer
ShowMusicInThisPC
ShowMusicInExplorer
ShowPicturesInThisPC
ShowPicturesInExplorer
ShowVideosInThisPC
ShowVideosInExplorer
Show3DObjectsInThisPC
Show3DObjectsInExplorer
SetControlPanelViewCategories
SetVisualFXAppearance
EnableThumbnails
EnableThumbsDB
@@ -81,7 +98,6 @@ EnableOneDrive
InstallMsftBloat
InstallThirdPartyBloat
InstallWindowsStore
EnableConsumerApps
EnableXboxFeatures
EnableAdobeFlash
InstallMediaPlayer
@@ -94,6 +110,7 @@ EnableSearchAppInStore
EnableNewAppPrompt
DisableF8BootMenu
SetDEPOptIn
DisableMeltdownCompatFlag
ShowServerManagerOnLogin
EnableShutdownTracker