Created
February 18, 2023 16:44
-
-
Save Crydust/f3ce3959edddc7cc77da702d020e8640 to your computer and use it in GitHub Desktop.
remove junk from windows 10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Host "Creating Restore Point in case something bad happens" | |
Enable-ComputerRestore -Drive "$env:SystemDrive" | |
Checkpoint-Computer -Description "RestorePoint1" -RestorePointType "MODIFY_SETTINGS" | |
#WPFEssTweaksDVR | |
If (!(Test-Path "HKCU:\System\GameConfigStore")) { | |
New-Item -Path "HKCU:\System\GameConfigStore" -Force | |
} | |
Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_DXGIHonorFSEWindowsCompatible" -Type DWord -Value 1 | |
Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_HonorUserFSEBehaviorMode" -Type DWord -Value 1 | |
Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_EFSEFeatureFlags" -Type DWord -Value 0 | |
Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_Enabled" -Type DWord -Value 0 | |
Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_FSEBehavior" -Type DWord -Value 2 | |
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR")) { | |
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" -Force | |
} | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" -Name "AllowGameDVR" -Type DWord -Value 0 | |
Write-Host "Disabling Location Tracking..." | |
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location")) { | |
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Force | Out-Null | |
} | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Type String -Value "Deny" | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 0 | |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 0 | |
Write-Host "Disabling automatic Maps updates..." | |
Set-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -Type DWord -Value 0 | |
Write-Host "Set Services to Manual" | |
$services = @( | |
"ALG" # Application Layer Gateway Service(Provides support for 3rd party protocol plug-ins for Internet Connection Sharing) | |
"AJRouter" # Needed for AllJoyn Router Service | |
"BcastDVRUserService_48486de" # GameDVR and Broadcast is used for Game Recordings and Live Broadcasts | |
#"BDESVC" # Bitlocker Drive Encryption Service | |
#"BFE" # Base Filtering Engine (Manages Firewall and Internet Protocol security) | |
#"BluetoothUserService_48486de" # Bluetooth user service supports proper functionality of Bluetooth features relevant to each user session. | |
#"BrokerInfrastructure" # Windows Infrastructure Service (Controls which background tasks can run on the system) | |
#"Browser" # Let users browse and locate shared resources in neighboring computers | |
#"BthAvctpSvc" # AVCTP service (needed for Bluetooth Audio Devices or Wireless Headphones) | |
#"CaptureService_48486de" # Optional screen capture functionality for applications that call the Windows.Graphics.Capture API. | |
#"cbdhsvc_48486de" # Clipboard Service | |
"diagnosticshub.standardcollector.service" # Microsoft (R) Diagnostics Hub Standard Collector Service | |
"DiagTrack" # Diagnostics Tracking Service | |
"dmwappushservice" # WAP Push Message Routing Service | |
"DPS" # Diagnostic Policy Service (Detects and Troubleshoots Potential Problems) | |
"edgeupdate" # Edge Update Service | |
"edgeupdatem" # Another Update Service | |
#"EntAppSvc" # Enterprise Application Management. | |
"Fax" # Fax Service | |
"fhsvc" # Fax History | |
#"FontCache" # Windows font cache | |
#"FrameServer" # Windows Camera Frame Server (Allows multiple clients to access video frames from camera devices) | |
"gupdate" # Google Update | |
"gupdatem" # Another Google Update Service | |
#"iphlpsvc" # ipv6(Most websites use ipv4 instead) - Needed for Xbox Live | |
"lfsvc" # Geolocation Service | |
#"LicenseManager" # Disable LicenseManager (Windows Store may not work properly) | |
"lmhosts" # TCP/IP NetBIOS Helper | |
"MapsBroker" # Downloaded Maps Manager | |
"MicrosoftEdgeElevationService" # Another Edge Update Service | |
"MSDTC" # Distributed Transaction Coordinator | |
"NahimicService" # Nahimic Service | |
#"ndu" # Windows Network Data Usage Monitor (Disabling Breaks Task Manager Per-Process Network Monitoring) | |
"NetTcpPortSharing" # Net.Tcp Port Sharing Service | |
"PcaSvc" # Program Compatibility Assistant Service | |
"PerfHost" # Remote users and 64-bit processes to query performance. | |
"PhoneSvc" # Phone Service(Manages the telephony state on the device) | |
#"PNRPsvc" # Peer Name Resolution Protocol (Some peer-to-peer and collaborative applications, such as Remote Assistance, may not function, Discord will still work) | |
#"p2psvc" # Peer Name Resolution Protocol(Enables multi-party communication using Peer-to-Peer Grouping. If disabled, some applications, such as HomeGroup, may not function. Discord will still work)iscord will still work) | |
#"p2pimsvc" # Peer Networking Identity Manager (Peer-to-Peer Grouping services may not function, and some applications, such as HomeGroup and Remote Assistance, may not function correctly. Discord will still work) | |
#"PrintNotify" # Windows printer notifications and extentions | |
"QWAVE" # Quality Windows Audio Video Experience (audio and video might sound worse) | |
"RemoteAccess" # Routing and Remote Access | |
"RemoteRegistry" # Remote Registry | |
"RetailDemo" # Demo Mode for Store Display | |
#"RtkBtManServ" # Realtek Bluetooth Device Manager Service | |
"SCardSvr" # Windows Smart Card Service | |
"seclogon" # Secondary Logon (Disables other credentials only password will work) | |
"SEMgrSvc" # Payments and NFC/SE Manager (Manages payments and Near Field Communication (NFC) based secure elements) | |
"SharedAccess" # Internet Connection Sharing (ICS) | |
#"Spooler" # Printing | |
"stisvc" # Windows Image Acquisition (WIA) | |
#"StorSvc" # StorSvc (usb external hard drive will not be reconized by windows) | |
#"SysMain" # Analyses System Usage and Improves Performance | |
"TrkWks" # Distributed Link Tracking Client | |
#"WbioSrvc" # Windows Biometric Service (required for Fingerprint reader / facial detection) | |
#"WerSvc" # Windows error reporting | |
"wisvc" # Windows Insider program(Windows Insider will not work if Disabled) | |
#"WlanSvc" # WLAN AutoConfig | |
"WMPNetworkSvc" # Windows Media Player Network Sharing Service | |
"WpcMonSvc" # Parental Controls | |
"WPDBusEnum" # Portable Device Enumerator Service | |
"WpnService" # WpnService (Push Notifications may not work) | |
#"wscsvc" # Windows Security Center Service | |
#"WSearch" # Windows Search | |
"XblAuthManager" # Xbox Live Auth Manager (Disabling Breaks Xbox Live Games) | |
"XblGameSave" # Xbox Live Game Save Service (Disabling Breaks Xbox Live Games) | |
"XboxNetApiSvc" # Xbox Live Networking Service (Disabling Breaks Xbox Live Games) | |
"XboxGipSvc" # Xbox Accessory Management Service | |
# Hp services | |
"HPAppHelperCap" | |
"HPDiagsCap" | |
"HPNetworkCap" | |
"HPSysInfoCap" | |
"HpTouchpointAnalyticsService" | |
# Hyper-V services | |
"HvHost" | |
"vmicguestinterface" | |
"vmicheartbeat" | |
"vmickvpexchange" | |
"vmicrdv" | |
"vmicshutdown" | |
"vmictimesync" | |
"vmicvmsession" | |
# Services that cannot be disabled | |
#"WdNisSvc" | |
) | |
foreach ($service in $services) { | |
# -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist | |
Write-Host "Setting $service StartupType to Manual" | |
Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Manual -ErrorAction SilentlyContinue | |
} | |
Write-Host "Disabling Storage Sense..." | |
Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" -Recurse -ErrorAction SilentlyContinue | |
#--- | |
Write-Host "Disabling Telemetry..." | |
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 | |
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 | |
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-338387Enabled" -Type DWord -Value 0 | |
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338388Enabled" -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 "SubscribedContent-353698Enabled" -Type DWord -Value 0 | |
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -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 | |
Write-Host "Disabling Feedback..." | |
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) { | |
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 | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "DoNotShowFeedbackNotifications" -Type DWord -Value 1 | |
Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClient" -ErrorAction SilentlyContinue | Out-Null | |
Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" -ErrorAction SilentlyContinue | Out-Null | |
Write-Host "Disabling Tailored Experiences..." | |
If (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) { | |
New-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force | Out-Null | |
} | |
Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -Type DWord -Value 1 | |
Write-Host "Disabling Advertising ID..." | |
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo")) { | |
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" | Out-Null | |
} | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Name "DisabledByGroupPolicy" -Type DWord -Value 1 | |
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 | |
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 | |
} | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1 | |
Write-Host "Stopping and disabling Diagnostics Tracking Service..." | |
Stop-Service "DiagTrack" -WarningAction SilentlyContinue | |
Set-Service "DiagTrack" -StartupType Disabled | |
Write-Host "Stopping and disabling WAP Push Service..." | |
Stop-Service "dmwappushservice" -WarningAction SilentlyContinue | |
Set-Service "dmwappushservice" -StartupType Disabled | |
Write-Host "Enabling F8 boot menu options..." | |
bcdedit /set `{current`} bootmenupolicy Legacy | Out-Null | |
Write-Host "Disabling Remote Assistance..." | |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 0 | |
Write-Host "Stopping and disabling Superfetch service..." | |
Stop-Service "SysMain" -WarningAction SilentlyContinue | |
Set-Service "SysMain" -StartupType Disabled | |
Write-Host "Showing file operations details..." | |
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager")) { | |
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" | Out-Null | |
} | |
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Name "EnthusiastMode" -Type DWord -Value 1 | |
Write-Host "Hiding Task View button..." | |
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Type DWord -Value 0 | |
Write-Host "Hiding People icon..." | |
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People")) { | |
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" | Out-Null | |
} | |
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" -Name "PeopleBand" -Type DWord -Value 0 | |
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 | |
## Enable Long Paths | |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Type DWORD -Value 1 | |
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 | |
## Performance Tweaks and More Telemetry | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" -Name "SearchOrderConfig" -Type DWord -Value 0 | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -Name "SystemResponsiveness" -Type DWord -Value 0 | |
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "MenuShowDelay" -Type DWord -Value 1 | |
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "AutoEndTasks" -Type DWord -Value 1 | |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" -Name "ClearPageFileAtShutdown" -Type DWord -Value 0 | |
Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseHoverTime" -Type DWord -Value 400 | |
## Timeout Tweaks cause flickering on Windows now | |
Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "WaitToKillAppTimeout" -ErrorAction SilentlyContinue | |
Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "HungAppTimeout" -ErrorAction SilentlyContinue | |
Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control" -Name "WaitToKillServiceTimeout" -ErrorAction SilentlyContinue | |
Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "LowLevelHooksTimeout" -ErrorAction SilentlyContinue | |
Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "WaitToKillServiceTimeout" -ErrorAction SilentlyContinue | |
# Network Tweaks | |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "IRPStackSize" -Type DWord -Value 20 | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -Name "NetworkThrottlingIndex" -Type DWord -Value 4294967295 | |
# Gaming Tweaks | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" -Name "GPU Priority" -Type DWord -Value 8 | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" -Name "Priority" -Type DWord -Value 6 | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" -Name "Scheduling Category" -Type String -Value "High" | |
# Group svchost.exe processes | |
$ram = (Get-CimInstance -ClassName "Win32_PhysicalMemory" | Measure-Object -Property Capacity -Sum).Sum / 1kb | |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control" -Name "SvcHostSplitThresholdInKB" -Type DWord -Value $ram -Force | |
Write-Host "Disable News and Interests" | |
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds")) { | |
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" | Out-Null | |
} | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Name "EnableFeeds" -Type DWord -Value 0 | |
# Remove "News and Interest" from taskbar | |
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds" -Name "ShellFeedsTaskbarViewMode" -Type DWord -Value 2 | |
# remove "Meet Now" button from taskbar | |
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) { | |
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Force | Out-Null | |
} | |
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "HideSCAMeetNow" -Type DWord -Value 1 | |
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" | |
} | |
icacls $autoLoggerDir /deny SYSTEM:`(OI`)`(CI`)F | Out-Null | |
Write-Host "Stopping and disabling Diagnostics Tracking Service..." | |
Stop-Service "DiagTrack" | |
Set-Service "DiagTrack" -StartupType Disabled | |
Write-Host "Doing Security checks for Administrator Account and Group Policy" | |
if (([System.Security.Principal.WindowsIdentity]::GetCurrent().Name).IndexOf('Administrator') -eq -1) { | |
net user administrator /active:no | |
} | |
Write-Host "Showing known file extensions..." | |
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 0 | |
Write-Host "Removing Cortana..." | |
Get-AppxPackage -allusers Microsoft.549981C3F5F10 | Remove-AppxPackage | |
$Bloatware = @( | |
#Unnecessary Windows 10 AppX Apps | |
"3DBuilder" | |
"Microsoft3DViewer" | |
"AppConnector" | |
"BingFinance" | |
"BingNews" | |
"BingSports" | |
"BingTranslator" | |
"BingWeather" | |
"BingFoodAndDrink" | |
"BingHealthAndFitness" | |
"BingTravel" | |
"MinecraftUWP" | |
"GamingServices" | |
# "WindowsReadingList" | |
"GetHelp" | |
"Getstarted" | |
"Messaging" | |
"Microsoft3DViewer" | |
"MicrosoftSolitaireCollection" | |
"NetworkSpeedTest" | |
"News" | |
"Lens" | |
"Sway" | |
"OneNote" | |
"OneConnect" | |
"People" | |
"Print3D" | |
"SkypeApp" | |
"Todos" | |
"Wallet" | |
"Whiteboard" | |
"WindowsAlarms" | |
"windowscommunicationsapps" | |
"WindowsFeedbackHub" | |
"WindowsMaps" | |
"WindowsPhone" | |
"WindowsSoundRecorder" | |
"XboxApp" | |
"ConnectivityStore" | |
"CommsPhone" | |
"ScreenSketch" | |
"TCUI" | |
"XboxGameOverlay" | |
"XboxGameCallableUI" | |
"XboxSpeechToTextOverlay" | |
"MixedReality.Portal" | |
"ZuneMusic" | |
"ZuneVideo" | |
#"YourPhone" | |
"Getstarted" | |
"MicrosoftOfficeHub" | |
#Sponsored Windows 10 AppX Apps | |
#Add sponsored/featured apps to remove in the "*AppName*" format | |
"EclipseManager" | |
"ActiproSoftwareLLC" | |
"AdobeSystemsIncorporated.AdobePhotoshopExpress" | |
"Duolingo-LearnLanguagesforFree" | |
"PandoraMediaInc" | |
"CandyCrush" | |
"BubbleWitch3Saga" | |
"Wunderlist" | |
"Flipboard" | |
"Twitter" | |
"Facebook" | |
"Royal Revolt" | |
"Sway" | |
"Speed Test" | |
"Dolby" | |
"Viber" | |
"ACGMediaPlayer" | |
"Netflix" | |
"OneCalendar" | |
"LinkedInforWindows" | |
"HiddenCityMysteryofShadows" | |
"Hulu" | |
"HiddenCity" | |
"AdobePhotoshopExpress" | |
"HotspotShieldFreeVPN" | |
#Optional: Typically not removed but you can if you need to | |
"Advertising" | |
#"MSPaint" | |
#"MicrosoftStickyNotes" | |
#"Windows.Photos" | |
#"WindowsCalculator" | |
#"WindowsStore" | |
# HPBloatware Packages | |
"HPJumpStarts" | |
"HPPCHardwareDiagnosticsWindows" | |
"HPPowerManager" | |
"HPPrivacySettings" | |
"HPSupportAssistant" | |
"HPSureShieldAI" | |
"HPSystemInformation" | |
"HPQuickDrop" | |
"HPWorkWell" | |
"myHP" | |
"HPDesktopSupportUtilities" | |
"HPQuickTouch" | |
"HPEasyClean" | |
"HPSystemInformation" | |
) | |
Write-Host "Removing Bloatware" | |
foreach ($Bloat in $Bloatware) { | |
Get-AppxPackage "*$Bloat*" | Remove-AppxPackage -ErrorAction SilentlyContinue | |
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like "*$Bloat*" | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue | |
Write-Host "Trying to remove $Bloat." | |
} | |
Write-Host "Finished Removing Bloatware Apps" | |
Write-Host "Removing Bloatware Programs" | |
# Remove installed programs | |
$InstalledPrograms = Get-Package | Where-Object { $UninstallPrograms -contains $_.Name } | |
$InstalledPrograms | ForEach-Object { | |
Write-Host -Object "Attempting to uninstall: [$($_.Name)]..." | |
Try { | |
$Null = $_ | Uninstall-Package -AllVersions -Force -ErrorAction SilentlyContinue | |
Write-Host -Object "Successfully uninstalled: [$($_.Name)]" | |
} | |
Catch { | |
Write-Warning -Message "Failed to uninstall: [$($_.Name)]" | |
} | |
} | |
Write-Host "Finished Removing Bloatware Programs" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment